note 62262 deleted from ref.array by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 19:23:50 +0000 |
| Subject: | note 62262 deleted from ref.array by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134505@lists.php.net to get a copy of this message | ||
Note Submitter: Nimja
----
A very clean and efficient function to remove empty values from an Array.
<?php
function cleanArray($array) {
foreach ($array as $index => $value) {
if (empty($value)) unset($array[$index]);
}
return $array;
}
?>