note 84008 deleted from function.trim by mazzanet
| From: | mazzanet@php.net | Date: | Thu, 20 Aug 2009 14:25:12 +0000 |
| Subject: | note 84008 deleted from function.trim by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159702@lists.php.net to get a copy of this message | ||
Note Submitter: Brizz
----
Someone posted this over two years ago, but it is still just as valid today. Frankly, it should be
added to the documentation on this page. This is NOT the functionality I would expect in this case.
With all this talk about trimming array values, it should be known that accidentally using the
trim() function with an array() argument ...
<?php
$array = array(1, 2, 3);
$array = trim($array);
print_r($array); // prints "Array"
echo($array); // also prints "Array"
?>
... yields the string "Array"