In PHP, given an array of arrays, how can I replace all empty values with 0?

Posted by stormist on Stack Overflow See other posts from Stack Overflow or by stormist
Published on 2010-04-15T18:24:19Z Indexed on 2010/04/15 18:33 UTC
Read the original article Hit count: 177

Filed under:
|
|

Example array

$myArray[0] = array('23, null, 43, 12');
$myArray[1] = array('null, null, 53, 19');
$myArray[2] = array('12, 13, 14, null');

All nulls should be replaced with 0. I was hoping someone would have an efficient way of doing this, perhaps a built in PHP function that I am unaware of.

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays