I have my data in an ArrayObject , just representing an array. I need to filter the data, array_filter() function will work fine. However, it does not work with ArrayObject as an argument. What is the best way to handle this? Is there a standard function that handles filtering for me?
Example:
$my_data = ArrayObject(array(1,2,3)); $result = array_object_filter($my_data, function($item) { return $item !== 2; });
Is there any function array_object_filter ?
php arrayobject array-filter
Pavel S.
source share