I need to exclude elements of the array $tempobjects from the array $objects. What is the quickest way to do this?
$objects = new MyObjects();
$tempobjects = new MyObjects();
for($i=0; $i<10; $i++) {
$objects->addObject(new MyObject(...));
}
//...fill $tempobjects with some temporary data
$tempobjects = $objects - $tempobjects; // HOW TO DO SOMETHING LIKE THIS?
array_difforarray_diff_assocare the usual ways to do this for arrays, but as mark baker said, you have objects, so those functions probably won't work. try converting your objects to arrays.