2
I have this code who returns me this array and if you notice, you can see that you have empty fields. What I can increment in this code so that where the index is empty receives the value null?
That’s how it works, but for my array multidimensional 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 @Jader’s solution, the array_walk_recursive
, Maybe I applied the same solution of @Papa Charlie but I ended up understanding better by the reply of @Jader. The solution presented allowed me with the function to access several levels of array that was multidimensional.
An empty Dice is null.
– Papa Charlie
I edited the title to make it more suggestive, okay?
– Papa Charlie