I have this code that returns this array and if you notice, you can see that there are empty fields. What can I increment in this code so that where the index is empty receive the value null ?
This works, but for my multidimensional array it did not work.
$array = array('A'=>1,'B'=>'','C'=>3,'D'=>'','E'=>5,'F'=>6);
array_walk($array , function( &$value , $field){
if(! $value) $value = '0';
});
print_r($array);
I resolved my application using the @Jader solution, array_walk_recursive
, maybe applied the same @Papa Charlie solution but I ended up getting a better understanding of @Jader's response. The solution presented allowed me with multi-level access to the array function that was multidimensional.