how to remove empty element from array

Home » PHP » how to remove empty element from array
Date: 2008-06-01
Link: http://php.devquickref.com/php-remove-empty-element-array-filter.html

This tip explains how to remove empty elements from a PHP array using array_filter function

 
$cleaned_array = array_filter($countries);
by not supplying a callback function to array_filter function it skips the empty values