View Single Post
Old 09-30-2007, 08:47 PM   #5 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

To further the last post, above, there is also the array_walk function which behaves similarly (but not the same!) as array_map.

array_walk (PHP manual page)
This does the same thing as the array_map example above.
PHP Code:
array_walk($MyInputArray'htmlspecialchars'); 
The important difference being that array_walk acts on the array itself, whereas array_map acts on a copy of it (sort of) by default.
Salathe is offline  
Reply With Quote