note 16902 added to function.array-walk
| From: | urs at circle dot ch | Date: | Sun, 18 Nov 2001 12:06:16 +0000 |
| Subject: | note 16902 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20972@lists.php.net to get a copy of this message | ||
Adding slashes [addslash] to each value of an array:
/**
* $arr is the input array
* $ret is the output array
*/
array_walk(&$arr, 'addslashes_array');
function addslashes_array (&$value, $key) {
global $arr, $ret;
foreach ($arr as $key => $val) {
$ret[$key] = addslashes($val);
}
}
--
http://www.php.net/manual/en/function.array-walk.php
http://master.php.net/manage/user-notes.php?action=edit+16902
http://master.php.net/manage/user-notes.php?action=delete+16902
http://master.php.net/manage/user-notes.php?action=reject+16902