cvs: phpdoc-da /reference/strings/functions stripslashes.xml

From: Date: Sat, 02 Oct 2004 22:51:41 +0000
Subject: cvs: phpdoc-da /reference/strings/functions stripslashes.xml
Groups: php.doc.da 
Request: Send a blank email to doc-da+get-266@lists.php.net to get a copy of this message
tomsommer Sat Oct 2 18:51:41 2004 EDT Modified files: /phpdoc-da/reference/strings/functions stripslashes.xml Log: Sync with EN http://cvs.php.net/diff.php/phpdoc-da/reference/strings/functions/stripslashes.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-da/reference/strings/functions/stripslashes.xml diff -u phpdoc-da/reference/strings/functions/stripslashes.xml:1.2 phpdoc-da/reference/strings/functions/stripslashes.xml:1.3 --- phpdoc-da/reference/strings/functions/stripslashes.xml:1.2 Fri Jul 23 16:57:24 2004 +++ phpdoc-da/reference/strings/functions/stripslashes.xml Sat Oct 2 18:51:41 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.3 Maintainer: tomsommer Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.5 Maintainer: tomsommer Status: ready --> <refentry id="function.stripslashes"> <refnamediv> <refname>stripslashes</refname> @@ -42,6 +42,58 @@ ]]> </programlisting> </example> + </para> + <note> + <para> + <function>stripslashes</function> er ikke rekursiv. Hvis du vil påføre + denne funktion på et multi-dimentionelt array, skal du bruge en rekursiv + funktion. + </para> + </note> + <para> + <example> + <title>Brug <function>stripslashes</function> på et array</title> + <programlisting role="php"> +<![CDATA[ +<?php +function stripslashes_deep($value) +{ + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; +} + +// Eksempel +$array = array("f\\'oo", "b\\'ar", array("fo\\'o", "b\\'ar")); +$array = stripslashes_deep($array); + +// Udskriv +print_r($array); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [0] => f'oo + [1] => b'ar + [2] => Array + ( + [0] => fo'o + [1] => b'ar + ) + +) +]]> + </screen> + </example> + </para> + <para> + For mere information omkring "magic quotes", se <function>get_magic_quotes_gpc</function>. </para> <simpara> Se også <function>addslashes</function> og

« previous php.doc.da (#266) next »