note 73901 deleted from function.stripslashes by nlopess
| From: | nlopess@php.net | Date: | Sun, 18 Mar 2007 12:38:58 +0000 |
| Subject: | note 73901 deleted from function.stripslashes by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-124565@lists.php.net to get a copy of this message | ||
Note Submitter: Manithu
----
To use the stripslashes_deep() function noted above with PHP versions < 4.0.6, use this function:
<?php
function stripslashes_deep(&$var)
{
if (is_string($var)) {
$var = stripslashes($var);
} else {
if (is_array($var)) {
foreach($var AS $key => $value) {
stripslashes_deep($var[$key]);
}
}
}
}
?>
This function will also directly change the variable.
Example usage at http://putnote.net/15