I have found several purported solutions to this question, but when I try and implement them, they do not work.
$a = array('val'=>10, 'name'=>'Name of A', 'item3'=>'item3forA');
$b = array('val'=>20, 'name'=>'Name of B', 'item3'=>'item3forB');
$c = array('val'=>30, 'name'=>'Name of C', 'item3'=>'item3forC');
$d = array('val'=>40, 'name'=>'Name of D', 'item3'=>'item3forD');
$rlist = array($a, $b, $c, $d);
I need a way to recursively / iteratively replace the value of the 'val' key to make them all a zero (0) value.
Two of the many solutions I have tried are here and here. I will also note if I 'explicitly' set the key to zero $a['val']=0; $b['val']=0; etc., that works, but I would rather set it to zero with less code (the actual program has like 20 multi-dimensional arrays to modify).