note 27784 deleted from function.get-magic-quotes-gpc by aidan
| From: | aidan@php.net | Date: | Tue, 06 Jul 2004 06:20:42 +0000 |
| Subject: | note 27784 deleted from function.get-magic-quotes-gpc by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72700@lists.php.net to get a copy of this message | ||
Note Submitter: joscha at feth dot com
----
Use this function:
function my_magic_quotes($var)
{
foreach($var AS $key => $value) {
if (is_array($value)) {
$var[$key] = my_magic_quotes($value);
} else {
$var[$key] = addslashes($value);
}
return $var;
}
if (!get_magic_quotes_gpc()) {
$_GET = my_magic_quotes($_GET);
}
You can download the commented source here:
http://dev.feth.com/PHP/my_magic_quotes.phps
greets,
Joscha Feth