note 64274 added to function.trim
| From: | php-general at lists dot php dot net | Date: | Tue, 11 Apr 2006 10:28:14 +0000 |
| Subject: | note 64274 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107748@lists.php.net to get a copy of this message | ||
A simple, recursive (another one) trim_array function (using pass by reference):
<?php
function _trim_array_trim(&$value){
if (is_array($value)){
trim_array($value);
} else {
$value = trim($value);
}
}
function trim_array(&$array){
array_walk($array, "_trim_array_trim");
}
?>
usage:
trim_array($myArray);
----
Server IP: 84.18.202.180
Probable Submitter: 86.131.196.50
----
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/function.trim.php
Edit -- http://master.php.net/note/edit/64274
Del: integrated -- http://master.php.net/note/delete/64274/integrated
Del: useless -- http://master.php.net/note/delete/64274/useless
Del: bad code -- http://master.php.net/note/delete/64274/bad+code
Del: spam -- http://master.php.net/note/delete/64274/spam
Del: non-english -- http://master.php.net/note/delete/64274/non-english
Del: in docs -- http://master.php.net/note/delete/64274/in+docs
Del: other reasons-- http://master.php.net/note/delete/64274
Reject -- http://master.php.net/note/reject/64274
Search -- http://master.php.net/manage/user-notes.php