I can\'t seem to find a simple, straight-forward solution to the age-old problem of removing empty elements from arrays in PHP.
My input array may look like this: <
Try using array_map() to apply the filter to every array in $array:
$array
$array = array_map('array_filter', $array); $array = array_filter($array);
Demo: http://codepad.org/xfXEeApj