note 16902 deleted from function.array-walk by zak
| From: | zak@php.net | Date: | Sun, 18 Nov 2001 12:19:29 +0000 |
| Subject: | note 16902 deleted from function.array-walk by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20975@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);
}
}