Filter Empty Array Elements

Description: Filters out any empty array elements from the submitted array.

<?PHP
 
// filter empty elements
$some_array = PREG_GREP('#\S#', ARRAY_MAP('trim', $some_array));
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.