I get a big data collection from a API, the array what I get has more objects who contains: id, name, place, zip.
Now I need to create filter this array, the code is:
$all_objects = $api_result->body->objects;
Of course I can do it with a foreach(), but what is the best way also for performances to filter it like get object by id 973?
$all_objects?array_filter.