note 63302 deleted from ref.array by levim
| From: | levim@php.net | Date: | Tue, 06 May 2014 22:04:30 +0000 |
| Subject: | note 63302 deleted from ref.array by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199452@lists.php.net to get a copy of this message | ||
Note Submitter: alessandronunes at gmail dot com
----
The Ninmja sugestion plus multidiomensional array search (recursive):
function cleanArray($array) {
foreach ($array as $index => $value) {
if(is_array($array[$index])) $array[$index] = cleanArray($array[$index]);
if (empty($value)) unset($array[$index]);
}
return $array;
}