note 14110 added to function.stripslashes.php
| From: | fferreres at joydivision dot com dot ar | Date: | Tue, 17 Jul 2001 22:16:27 +0000 |
| Subject: | note 14110 added to function.stripslashes.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15507@lists.php.net to get a copy of this message | ||
Same as above, but seems to work for multidimensional arrays...usefull when you need large arrays
(for example, when you want to serialize var into a database and then bring it back) ... It asumes
you have magic quotes on.
function stripslashes_array($arr = array()) {
$rs = array();
while (list($key,$val) = each($arr)) {
if(is_array($arr[$key])) $rs[$key] = stripslashes_array($arr[$key]); else $rs[$key] =
htmlspecialchars(stripslashes($val),ENT_QUOTES);
}
return $rs;
}
http://www.php.net/manual/en/function.stripslashes.php