Iterate through the array and return true or false based on the condition
$new_array = array_filter($array, function($obj){
if (isset($obj->admins)) {
foreach ($obj->admins as $admin) {
if ($admin->member == 11) return false;
}
}
return true;
});
No comments:
Post a Comment