note 67461 added to ref.array
| From: | THEBESTSCRIPTEVER dot dot dot MAYBE dot dot WELL dot dot at osu1 dot php dot net | Date: | Thu, 08 Jun 2006 01:56:50 +0000 |
| Subject: | note 67461 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-113736@lists.php.net to get a copy of this message | ||
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;
}
----
Server IP: 64.71.164.2
Probable Submitter: 72.197.239.33
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.array.php
Edit -- http://master.php.net/note/edit/67461
Del: integrated -- http://master.php.net/note/delete/67461/integrated
Del: useless -- http://master.php.net/note/delete/67461/useless
Del: bad code -- http://master.php.net/note/delete/67461/bad+code
Del: spam -- http://master.php.net/note/delete/67461/spam
Del: non-english -- http://master.php.net/note/delete/67461/non-english
Del: in docs -- http://master.php.net/note/delete/67461/in+docs
Del: other reasons-- http://master.php.net/note/delete/67461
Reject -- http://master.php.net/note/reject/67461
Search -- http://master.php.net/manage/user-notes.php