$id = 1;
foreach ($array as $key => $arr) {
if($arr->id == $id) {
unset($array[$key]);
}
}
$id = 1;
foreach ($array as $key => $arr) {
if($arr->id == $id) {
unset($array[$key]);
}
}