$arr = array($arr1,$arr2,..);
How to search through $arr
to find the one with key1 => 'something'
,key2 => 'something else'
$arr = array($arr1,$arr2,..);
How to search through $arr
to find the one with key1 => 'something'
,key2 => 'something else'
Try exporting in a string, and doing a search on it
$string = var_export($ar, true);
I guess there are no memory-efficient way here. You will have to loop through each sub-array to find your content. do let know if you find some better solution.
--Pinaki
You can iterate over a nested array with Iterators, e.g.
$iterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator($nestedArray),
RecursiveIteratorIterator::SELF_FIRST);
foreach($iterator as $key => val) {
if($key === 'something') {
echo $val;
}
}
Alternatively, have a look at array_walk_recursive