I\'m trying to delete empty elements in an array with the function array_filter.
When i use an external callback like this :
function callback($a) {
It seems that you’re using a PHP version that does not support anonymous functions (available since PHP 5.3.0).
But array_filter does already filter empty values if you don’t specify a callback function:
If no
callback
is supplied, all entries ofinput
equal to FALSE (see converting to boolean) will be removed.
It works well with PHP5. Check your PHP version, and upgrade if necessary.