note 34124 added to function.trim
| From: | mrizzo at advancedsl dot com dot ar | Date: | Wed, 16 Jul 2003 19:00:32 +0000 |
| Subject: | note 34124 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52220@lists.php.net to get a copy of this message | ||
About trim all elements in an array.
array_filter($db, 'trim') doesn't work becouse it does NOT modify array's
elements, it only returns a copy from those elements which return true on the callback function.
I think that:
foreach ($db as $key=>$value) { $db[$key]=trim($value); }
still being the best option.
----
Manual Page -- http://www.php.net/manual/en/function.trim.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34124
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34124&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34124&report=yes