Skip to content

Instantly share code, notes, and snippets.

@GeorgePeter
GeorgePeter / php_recursive_empty_array_filter
Last active November 19, 2015 21:41
php function to filter all null values of an associative array
function array_trim($input) {
return is_array($input) ?
array_filter($input, function (& $value) {
return $value = array_trim($value) or !is_null($value);
})
: $input;
}