Snippet. PHP. Remove Empty Elements from ArrayRecently had an array serialized into a string separated with ; which had to be brought back to array. The empty elements were of course not needed. So here is how to remove the empty elements.
$rooms = array_filter(explode(';', $rooms), create_function('$a','return $a!="";'));
Updated on: 01 Dec 2025 |
|
|