note 67461 deleted from ref.array by nlopess
| From: | nlopess@php.net | Date: | Thu, 08 Jun 2006 09:20:39 +0000 |
| Subject: | note 67461 deleted from ref.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-113765@lists.php.net to get a copy of this message | ||
Note Submitter: THE BEST SCRIPT EVER... MAYBE.. WELL..
----
This function will only remove array lines where the trim() function results in a empty value..
However it will leave Zeros, FALSE values alone..
function array_clean($array){
foreach($array as $key=>$val) {
if(is_array($array[$key])){
$array[$key] = array_clean($array[$key]);
}
if((trim($val)==NULL) and ($val!==FALSE)){
unset($array[$key]);
}
}
return $array;
}