PHP: removing zero values from an array
If you call array_filter without a callback function, it’ll remove all array elements that evaluate to false (including zeroes).
$numbers = array(0, 1, 2, 0); echo array_filter($numbers);
Produces:
array(1,2);
If you call array_filter without a callback function, it’ll remove all array elements that evaluate to false (including zeroes).
$numbers = array(0, 1, 2, 0); echo array_filter($numbers);
Produces:
array(1,2);