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?