cvs: phpdoc-it /reference/strings/functions sscanf.xml str-ireplace.xml str-repeat.xml str-replace.xml strchr.xml strip-tags.xml stripos.xml
stripslashes.xml stristr.xml strpos.xml

From: Date: Fri, 13 May 2005 12:27:15 +0000
Subject: cvs: phpdoc-it /reference/strings/functions sscanf.xml str-ireplace.xml str-repeat.xml str-replace.xml strchr.xml strip-tags.xml stripos.xml
stripslashes.xml stristr.xml strpos.xml
Groups: php.doc.it 
Request: Send a blank email to doc-it+get-715@lists.php.net to get a copy of this message
darvina Fri May 13 08:27:15 2005 EDT Modified files: /phpdoc-it/reference/strings/functions sscanf.xml str-ireplace.xml str-repeat.xml str-replace.xml strchr.xml strip-tags.xml stripos.xml stripslashes.xml stristr.xml strpos.xml Log: Sync to En tree

http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/sscanf.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/strings/functions/sscanf.xml diff -u phpdoc-it/reference/strings/functions/sscanf.xml:1.2 phpdoc-it/reference/strings/functions/sscanf.xml:1.3 --- phpdoc-it/reference/strings/functions/sscanf.xml:1.2 Thu Sep 16 08:20:39 2004 +++ phpdoc-it/reference/strings/functions/sscanf.xml Fri May 13 08:27:15 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> -<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.13 Maintainer: darvina Status: ready --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.33 --> <refentry id="function.sscanf"> <refnamediv> @@ -15,13 +15,14 @@ <type>mixed</type><methodname>sscanf</methodname> <methodparam><type>string</type><parameter>str</parameter></methodparam> <methodparam><type>string</type><parameter>format</parameter></methodparam> - <methodparam choice="opt"><type>mixed</type><parameter>&amp;...</parameter></methodparam> + <methodparam choice="opt"><type>mixed</type><parameter role="reference">...</parameter></methodparam> </methodsynopsis> <para> La funzione <function>sscanf</function> è la versione di input di <function>printf</function>. <function>sscanf</function> legge dalla stringa <parameter>str</parameter> e ne interpreta il contenuto - basandosi sul parametro <parameter>format</parameter>. Se vengono passati soltanto + basandosi sul parametro <parameter>format</parameter>, che viene descritto + nella documentazione di <function>sprintf</function>. Se vengono passati soltanto due parametri, i valori ricavati sono restituiti in una matrice. Altrimenti, se viene fornito il terzo parametro, la funzione restituire il numero dei valori assegnati. Il terzo parametro http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/str-ireplace.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/str-ireplace.xml diff -u phpdoc-it/reference/strings/functions/str-ireplace.xml:1.1 phpdoc-it/reference/strings/functions/str-ireplace.xml:1.2 --- phpdoc-it/reference/strings/functions/str-ireplace.xml:1.1 Thu Aug 12 09:55:10 2004 +++ phpdoc-it/reference/strings/functions/str-ireplace.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.str-ireplace"> <refnamediv> @@ -15,7 +15,7 @@ <methodparam><type>mixed</type><parameter>search</parameter></methodparam> <methodparam><type>mixed</type><parameter>replace</parameter></methodparam> <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>&amp;count</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter></methodparam> </methodsynopsis> <para> Questa funzione restituisce una stringa od una matrice con tutte le occorrenze @@ -61,10 +61,10 @@ </para> <note> <simpara> - Dal <literal>PHP 5.0.0</literal> il numero dei testi trovati e sostituiti + Dal PHP 5.0.0 il numero dei testi trovati e sostituiti sarà restituito in <parameter>count</parameter> che deve essere passato per riferimento. - Prima del <literal>PHP 5.0.0</literal> questo parametro non è disponibile. + Prima del PHP 5.0.0 questo parametro non è disponibile. </simpara> </note> <para> http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/str-repeat.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/str-repeat.xml diff -u phpdoc-it/reference/strings/functions/str-repeat.xml:1.1 phpdoc-it/reference/strings/functions/str-repeat.xml:1.2 --- phpdoc-it/reference/strings/functions/str-repeat.xml:1.1 Thu Aug 12 09:55:10 2004 +++ phpdoc-it/reference/strings/functions/str-repeat.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.str-repeat"> <refnamediv> @@ -29,10 +29,13 @@ ?> ]]> </programlisting> - </example> - <para> - Questo visualizzerà "-=-=-=-=-=-=-=-=-=-=". - </para> + &example.outputs; + <screen> +<![CDATA[ +-=-=-=-=-=-=-=-=-=-= +]]> + </screen> + </example> <para> Vedere anche <link linkend="control-structures.for">for</link>, <function>str_pad</function> e http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/str-replace.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/str-replace.xml diff -u phpdoc-it/reference/strings/functions/str-replace.xml:1.1 phpdoc-it/reference/strings/functions/str-replace.xml:1.2 --- phpdoc-it/reference/strings/functions/str-replace.xml:1.1 Thu Aug 12 09:55:10 2004 +++ phpdoc-it/reference/strings/functions/str-replace.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.15 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.18 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.str-replace"> <refnamediv> @@ -15,7 +15,7 @@ <methodparam><type>mixed</type><parameter>search</parameter></methodparam> <methodparam><type>mixed</type><parameter>replace</parameter></methodparam> <methodparam><type>mixed</type><parameter>subject</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>&amp;count</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter role="reference">count</parameter></methodparam> </methodsynopsis> <para> Questa funzione restituisce una stringa, od una matrice, con tutte le occorrenze @@ -36,7 +36,7 @@ che faceva ignorare gli indici vuoti di <parameter>search</parameter> avanzando il puntatore interno di <parameter>replace</parameter>, questo è stato corretto dal - <literal>PHP 4.3.3</literal>, ogni script che si basava su questo errore, + PHP 4.3.3, ogni script che si basava su questo errore, per potere simulare il comportamento originale, dovrebbe rimuovere gli elementi vuoti prima di richiamare questa funzione. </simpara> @@ -58,7 +58,8 @@ per completare i rimanenti valori da sostituire. Se <parameter>search</parameter> è una matrice e <parameter>replace</parameter> è una stringa, allora questa stringa di sostituzione sarà utilizzata per ogni valore di - <parameter>search</parameter>. + <parameter>search</parameter>. Il contrario non avrebbe + senso. </para> <para> <example> @@ -93,10 +94,10 @@ <note> <simpara> - Dal <literal>PHP 5.0.0</literal> il numero di stringhe trovate e + Dal PHP 5.0.0 il numero di stringhe trovate e e sostituite, sarà restituito nel parametro, passato per riferimento, <parameter>count</parameter>. - Nelle versioni antecedenti al <literal>PHP 5.0.0</literal> questo parametro non è disponibile. + Nelle versioni antecedenti al PHP 5.0.0 questo parametro non è disponibile. </simpara> </note> <para> http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/strchr.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/strchr.xml diff -u phpdoc-it/reference/strings/functions/strchr.xml:1.1 phpdoc-it/reference/strings/functions/strchr.xml:1.2 --- phpdoc-it/reference/strings/functions/strchr.xml:1.1 Mon Aug 9 08:01:48 2004 +++ phpdoc-it/reference/strings/functions/strchr.xml Fri May 13 08:27:15 2005 @@ -1,18 +1,20 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.4 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> - <refentry id="function.strchr"> - <refnamediv> - <refname>strchr</refname> - <refpurpose>Alias di <function>strstr</function></refpurpose> - </refnamediv> - <refsect1> - <title>Descrizione</title> - <para> - Questa funzione è un alias di <function>strstr</function>. - </para> - </refsect1> - </refentry> +<refentry id="function.strchr"> + <refnamediv> + <refname>strchr</refname> + <refpurpose>&Alias; <function>strstr</function></refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias; + <function>strstr</function>. + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/strip-tags.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/strings/functions/strip-tags.xml diff -u phpdoc-it/reference/strings/functions/strip-tags.xml:1.2 phpdoc-it/reference/strings/functions/strip-tags.xml:1.3 --- phpdoc-it/reference/strings/functions/strip-tags.xml:1.2 Thu Sep 16 08:20:39 2004 +++ phpdoc-it/reference/strings/functions/strip-tags.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.9 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.11 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.strip-tags"> <refnamediv> @@ -25,7 +25,11 @@ <note> <para> <parameter>allowable_tags</parameter> è stato aggiunto in PHP 3.0.13 - e PHP 4.0b3. Dal PHP 4.3.0, sono rimossi anche i commenti HTML. + e PHP 4.0b3. + </para> + <para> + Dal PHP 4.3.0, sono rimossi anche i commenti HTML. Questo comportamento è da programma + e non può essere modificato tramite <parameter>allowable_tags</parameter>. </para> </note> <warning> @@ -35,6 +39,15 @@ più testo di quanto atteso. </para> </warning> + <warning> + <para> + Questa funzione non modifica alcun attributo sui tag che sono abilitati + tramite <parameter>allowable_tags</parameter>, incluso lo + <literal>style</literal> e l'attributo <literal>onmouseover</literal> + che possono essere sfruttati da utenti malevoli quando pubblicano testi che + saranno visualizzati da altri utenti. + </para> + </warning> </para> <para> <example> @@ -42,48 +55,25 @@ <programlisting role="php"> <![CDATA[ <?php -$text = ' -<p>Test paragraph.</p> -<!-- Comment --> -Other text'; - +$text = '<p>Test paragraph.</p><!-- Comment --> Other text'; echo strip_tags($text); -echo "\n\n-------\n"; - +echo "\n"; // allow <p> echo strip_tags($text, '<p>'); ?> ]]> </programlisting> - <para> - L'esempio precedente visualizzerà: - </para> + &example.outputs; <screen> <![CDATA[ -Test paragraph. - -Other text - -------- - -<p>Test paragraph.</p> - -Other text +Test paragraph. Other text +<p>Test paragraph.</p> Other text ]]> </screen> </example> - </para> - <warning> - <para> - Questa funzione non modifica gli attributi nei tag ignorati tramite - <parameter>allowable_tags</parameter>, compresi gli attributi - <literal>style</literal> e <literal>onmouseover</literal> che - un utente maligno può utilizzare per inviare testo che sarà visualizzato - agli altri utenti. - </para> - </warning> + </para> <para> La funzione <function>strip_tags</function> è sicura con i contenuti binari dal PHP 5.0.0 </para> http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/stripos.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/strings/functions/stripos.xml diff -u phpdoc-it/reference/strings/functions/stripos.xml:1.2 phpdoc-it/reference/strings/functions/stripos.xml:1.3 --- phpdoc-it/reference/strings/functions/stripos.xml:1.2 Thu Sep 16 08:20:39 2004 +++ phpdoc-it/reference/strings/functions/stripos.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: darvina Status: ready --> <refentry id="function.stripos"> <refnamediv> <refname>stripos</refname> http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/stripslashes.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/stripslashes.xml diff -u phpdoc-it/reference/strings/functions/stripslashes.xml:1.1 phpdoc-it/reference/strings/functions/stripslashes.xml:1.2 --- phpdoc-it/reference/strings/functions/stripslashes.xml:1.1 Mon Aug 9 08:01:48 2004 +++ phpdoc-it/reference/strings/functions/stripslashes.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.3 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.stripslashes"> <refnamediv> @@ -43,6 +43,57 @@ </programlisting> </example> </para> + <note> + <para> + La funzione <function>stripslashes</function> non è ricorsiva Se si desidera utilizzare + questa funzione su una matrice multi-dimensionale, occorre utilizzare una funzione ricorsiva. + </para> + </note> + <para> + <example> + <title>Esempio di utilizzo di <function>stripslashes</function> su una matrice</title> + <programlisting role="php"> +<![CDATA[ +<?php +function stripslashes_deep($value) +{ + $value = is_array($value) ? + array_map('stripslashes_deep', $value) : + stripslashes($value); + + return $value; +} + +// Example +$array = array("f\\'oo", "b\\'ar", array("fo\\'o", "b\\'ar")); +$array = stripslashes_deep($array); + +// Output +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> + Per maggiori dettagli su "magic quotes", vedere <function>get_magic_quotes_gpc</function>. + </para> <simpara> Vedere anche <function>addslashes</function> e <function>get_magic_quotes_gpc</function>. http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/stristr.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-it/reference/strings/functions/stristr.xml diff -u phpdoc-it/reference/strings/functions/stristr.xml:1.1 phpdoc-it/reference/strings/functions/stristr.xml:1.2 --- phpdoc-it/reference/strings/functions/stristr.xml:1.1 Thu Aug 12 09:55:10 2004 +++ phpdoc-it/reference/strings/functions/stristr.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.8 --> <refentry id="function.stristr"> <refnamediv> @@ -35,12 +35,41 @@ <![CDATA[ <?php $email = 'USER@EXAMPLE.com'; - $domain = stristr($email, 'e'); - echo $domain; + echo stristr($email, 'e'); // outputs ER@EXAMPLE.com ?> ]]> </programlisting> + </example> + </para> + <para> + <example> + <title>Verifica se una stringa esiste o meno</title> + <programlisting role="php"> +<![CDATA[ +<?php + $string = 'Hello World!'; + if(stristr($string, 'earth') === FALSE) { + echo '"earth" not found in string'; + } +// outputs: "earth" not found in string +?> +]]> + </programlisting> + </example> + </para> + <para> + <example> + <title>Utilizzo di un dato non stringa da cercare</title> + <programlisting role="php"> +<![CDATA[ +<?php + $string = 'APPLE'; + echo stristr($string, 97); // 97 = lowercase a +// outputs: APPLE +?> +]]> + </programlisting> </example> </para> http://cvs.php.net/diff.php/phpdoc-it/reference/strings/functions/strpos.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-it/reference/strings/functions/strpos.xml diff -u phpdoc-it/reference/strings/functions/strpos.xml:1.2 phpdoc-it/reference/strings/functions/strpos.xml:1.3 --- phpdoc-it/reference/strings/functions/strpos.xml:1.2 Thu Sep 16 08:20:39 2004 +++ phpdoc-it/reference/strings/functions/strpos.xml Fri May 13 08:27:15 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- EN-Revision: 1.5 Maintainer: darvina Status: ready --> +<!-- EN-Revision: 1.8 Maintainer: darvina Status: ready --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.8 --> <refentry id="function.strpos"> <refnamediv> @@ -13,7 +13,7 @@ <methodsynopsis> <type>int</type><methodname>strpos</methodname> <methodparam><type>string</type><parameter>haystack</parameter></methodparam> - <methodparam><type>string</type><parameter>needle</parameter></methodparam> + <methodparam><type>mixed</type><parameter>needle</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> </methodsynopsis> <para> @@ -30,7 +30,7 @@ </para> &return.falseproblem; - + &note.bin-safe; <para> <example> <title>Esempio di uso di <function>strpos</function></title>
« previous php.doc.it (#715) next »