Given the following array structure:
$array = array('level1'=>array('level2'=>array('url'=>$url,'title'=>$title)));
using:
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
foreach($iterator as $key=>$value) {
if(is_null($value)){
echo $key.' -- '.$value.'<br />';
}
}
I can echo out when a value is null, but what I don't know is the array path for that item
When this is a more complex array, I need to know that the path that had the null was $array['level1']['level2']['url'] for example.
currently I only know it was url with no idea where in the structure the item actually was.
Using this iterator method, how can I work out what the path is so I can update the item in the array when its null?