note 30316 deleted from function.trim by aidan
| From: | aidan@php.net | Date: | Thu, 02 Sep 2004 07:07:45 +0000 |
| Subject: | note 30316 deleted from function.trim by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75925@lists.php.net to get a copy of this message | ||
Note Submitter: thomaspeulen at gmx dot de
----
If you want to trim a "array-tree" you can do it by recursion.
I think with this script you can trim the values of whatever array.
function trimdr( &$r ){
if(gettype($r) = "array" ){
foreach($r as $key => $value){
trimdr($r[$key]);
}
}
else{
$r=trim( (string) $r );
}
}
function trimdata( &$d ){
trimdr($d);
}