note 30316 added to function.trim

From: Date: Thu, 13 Mar 2003 21:59:07 +0000
Subject: note 30316 added to function.trim
Groups: php.notes 
Request: Send a blank email to php-notes+get-45231@lists.php.net to get a copy of this message
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); } -- http://www.php.net/manual/en/function.trim.php http://master.php.net/manage/user-notes.php?action=edit+30316 http://master.php.net/manage/user-notes.php?action=delete+30316 http://master.php.net/manage/user-notes.php?action=reject+30316

« previous php.notes (#45231) next »