Here is what I'm trying to do : I have an array of strings (containing id) and an array of objects. I'm trying to get all the ids listed in the first array that are not in the object array.
Here is what I tried $ids
is the array of strings and $features
is the array of objects :
array_udiff($ids, $features, function($a, $b){
return strcmp($a, $b->getIdFeature());
});
but I get an error
Fatal : Call to a member function getIdFeature() on string
I thought ids goes in $a
and features in $b
, this is not the case ? Is there a way to force this ?