0
Phpworker posted
remove duplicate object from array in php
i have $list which is array of the object with id and other values , i am removing the all object who have id is equal to $idin short want to remove duplicate object from array $list
$id=10;
foreach($list as $value){
if($value->id==$id){
$newlist[$value->id]=$list;
}
}
is there array_unique like function for the object like object_unique .
above code is working but i want to do it without foreach or any other loop so any how i can shrink code or make performance better