Remove zero values from a PHP array

array_filter does that. If you don’t supply a callback function, it filters all values out that equal false (boolean conversion).

Leave a Comment