note 103056 added to function.array-walk
| From: | at jfredys | Date: | Wed, 23 Mar 2011 01:07:12 +0000 |
| Subject: | note 103056 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178112@lists.php.net to get a copy of this message | ||
I was looking for trimming all the elements in an array, I found this as the simplest solution:
array_walk($ids, create_function('&$val', '$val = trim($val);'));
----
Server IP: 69.147.83.197
Probable Submitter: 190.156.131.186
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- https://master.php.net/note/edit/103056
Del: integrated -- https://master.php.net/note/delete/103056/integrated
Del: useless -- https://master.php.net/note/delete/103056/useless
Del: bad code -- https://master.php.net/note/delete/103056/bad+code
Del: spam -- https://master.php.net/note/delete/103056/spam
Del: non-english -- https://master.php.net/note/delete/103056/non-english
Del: in docs -- https://master.php.net/note/delete/103056/in+docs
Del: other reasons-- https://master.php.net/note/delete/103056
Reject -- https://master.php.net/note/reject/103056
Search -- https://master.php.net/manage/user-notes.php