Remove empty elements from array

Uses array_filter() to remove empty elements.

php
fork add to bundle source
function remove_empty_elements($array) { return array_filter($array, function($value) { return $value ? true : false; }); }

usage

load_function('remove_empty_elements'); $array = [ '25', '', ['where' => 'here'] ]; $clean_array = remove_empty_elements($array); print_r($clean_array); // Array // ( // [0] => 25 // [2] => Array // ( // [where] => here // ) // )
← how to use this in app?
create log ...inout