note 21022 modified in function.stripslashes by torben
| From: | torben@php.net | Date: | Thu, 25 Apr 2002 18:27:36 +0000 |
| Subject: | note 21022 modified in function.stripslashes by torben | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29847@lists.php.net to get a copy of this message | ||
Wouldn't be better to make it like this to prevent non-string values to be modified to string
values?
function stripslashes_array(&$array) {
while (list($key) = each($array)) {
if (is_array($array[$key])) {
stripslashes_array($array[$key]);
}
elseif (is_str($array[$key])) {
$array[$key] = stripslashes($array[$key]);
}
}
}
--was--
Wouldn't be better to make it like this to prevent non-string values to be modified to string
values?
function stripslashes_array(&$array) {
while (list($key) = each($array)) {
if (is_array($array[$key])) {
stripslashes_array($array[$key]);
}
elseif (is_str($array[$key])) {
$array[$key] = stripslashes($array[$key]);
}
}
}
http://www.php.net/manual/en/function.stripslashes.php