fbpx

Easy peasy:

$newArray = array_filter($array);

What if they aren’t truly empty, but contain blanks, you ask?

$trimmedArray = array_map('trim', $array);
$newArray = array_filter($trimmedArray);