Re: cvs: phpdoc /en/reference/info/functions get-magic-quotes-gpc.xml

From: Date: Tue, 06 Jul 2004 08:25:01 +0000
Subject: Re: cvs: phpdoc /en/reference/info/functions get-magic-quotes-gpc.xml
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969361701@lists.php.net to get a copy of this message
+    <para>
+     In the interests of writing portable code (code that works
+     in any enviroment), or, if you do not have access to change
+     php.ini, you may wish to disable the effects of magic quotes
+     on a per-script basis. This can be done in two ways, with a
+     directive in a .htaccess file (php_value magic_quotes_gpc 0),
+     or by adding the below code to the top of your scripts.
+     <example>
+      <title>Disabling magic quotes at runtime</title>
+      <programlisting role="php">
+<![CDATA[ +<?php +if (get_magic_quotes_gpc()) {
+    $_POST = array_map('stripslashes', $_POST);
+    $_GET = array_map('stripslashes', $_GET);
+    $_COOKIE = array_map('stripslashes', $_COOKIE);
+} +]]>
Array_map() will not work with multidimensional arrays, will it? Goba

« previous php.doc (#969361701) next »