note 82287 added to function.trim
| From: | JH at osu1 dot php dot net | Date: | Fri, 04 Apr 2008 07:31:56 +0000 |
| Subject: | note 82287 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137916@lists.php.net to get a copy of this message | ||
I encountred a wierd bug with trim. The code was something like this:
<?php
// $array is a multidimenssional array
foreach($array as $val) {
$this->rules[trim($val[1])] .= $val[2];
}
?>
This however works perfectly well.
<?php
foreach($array as $val) {
$value = trim($val[1]);
$this->rules[$value] .= $val[2];
}
?>
----
Server IP: 212.24.129.51
Probable Submitter: 80.95.121.33
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit -- https://master.php.net/note/edit/82287
Del: integrated -- https://master.php.net/note/delete/82287/integrated
Del: useless -- https://master.php.net/note/delete/82287/useless
Del: bad code -- https://master.php.net/note/delete/82287/bad+code
Del: spam -- https://master.php.net/note/delete/82287/spam
Del: non-english -- https://master.php.net/note/delete/82287/non-english
Del: in docs -- https://master.php.net/note/delete/82287/in+docs
Del: other reasons-- https://master.php.net/note/delete/82287
Reject -- https://master.php.net/note/reject/82287
Search -- https://master.php.net/manage/user-notes.php