cvs: phpdoc-it /reference/array/functions array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml
array-merge-recursive.xml

From: Date: Sat, 09 Aug 2003 11:22:01 +0000
Subject: cvs: phpdoc-it /reference/array/functions array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml
array-merge-recursive.xml
Groups: php.doc.it 
Request: Send a blank email to doc-it+get-453@lists.php.net to get a copy of this message
cucinato Sat Aug 9 07:22:01 2003 EDT Modified files: /phpdoc-it/reference/array/functions array-flip.xml array-intersect.xml array-key-exists.xml array-keys.xml array-map.xml array-merge-recursive.xml Log: Sync to EN revision

Index: phpdoc-it/reference/array/functions/array-flip.xml diff -u phpdoc-it/reference/array/functions/array-flip.xml:1.6 phpdoc-it/reference/array/functions/array-flip.xml:1.7 --- phpdoc-it/reference/array/functions/array-flip.xml:1.6 Sun May 4 10:12:50 2003 +++ phpdoc-it/reference/array/functions/array-flip.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.21 --> <!-- last change to 'array-flip' in en/ tree in rev 1.107 --> -<!-- EN-Revision: 1.7 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.10 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.107 --> <refentry id="function.array-flip"> <refnamediv> @@ -39,8 +39,10 @@ <title>Esempio di <function>array_flip</function></title> <programlisting role="php"> <![CDATA[ +<?php $trans = array_flip ($trans); $original = strtr ($str, $trans); +?> ]]> </programlisting> </example> @@ -50,14 +52,17 @@ <title>Esempio di <function>array_flip</function>: collisione</title> <programlisting role="php"> <![CDATA[ +<?php $trans = array ("a" => 1, "b" => 1, "c" => 2); $trans = array_flip ($trans); print_r($trans); +?> ]]> </programlisting> <para> ora <varname>$trans</varname> è: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -65,9 +70,13 @@ [2] => c ) ]]> - </screen> - </para> + </screen> </example> + </para> + <para> + Vedere anche <function>array_values</function>, + <function>array_keys</function> e + <function>array_reverse</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/array/functions/array-intersect.xml diff -u phpdoc-it/reference/array/functions/array-intersect.xml:1.5 phpdoc-it/reference/array/functions/array-intersect.xml:1.6 --- phpdoc-it/reference/array/functions/array-intersect.xml:1.5 Thu Feb 20 17:55:22 2003 +++ phpdoc-it/reference/array/functions/array-intersect.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.1 --> <!-- last change to 'array-intersect' in en/ tree in rev 1.14 --> -<!-- EN-Revision: 1.6 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.14 --> <refentry id="function.array-intersect"> <refnamediv> @@ -27,14 +27,17 @@ <title>Esempio di <function>array_intersect</function></title> <programlisting role="php"> <![CDATA[ +<?php $array1 = array ("a" => "verde", "rosso", "blu"); $array2 = array ("b" => "verde", "giallo", "rosso"); $risultato = array_intersect ($array1, $array2); +?> ]]> </programlisting> <para> In questo modo <varname>$result</varname> sarà: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -42,8 +45,7 @@ [0] => rosso ) ]]> - </screen> - </para> + </screen> </example> </para> <note> @@ -54,12 +56,6 @@ <!-- TODO: un esempio... --> </simpara> </note> - <warning> - <simpara> - Questa funzione era errata nel PHP 4.0.4! - <!-- TODO: when exactly was this broken?... --> - </simpara> - </warning> <para> Vedere anche <function>array_intersect_assoc</function>, <function>array_diff</function> e Index: phpdoc-it/reference/array/functions/array-key-exists.xml diff -u phpdoc-it/reference/array/functions/array-key-exists.xml:1.4 phpdoc-it/reference/array/functions/array-key-exists.xml:1.5 --- phpdoc-it/reference/array/functions/array-key-exists.xml:1.4 Mon Jun 24 20:07:35 2002 +++ phpdoc-it/reference/array/functions/array-key-exists.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.27 --> <!-- last change to 'array-key-exists' in en/ tree in rev 1.119 --> -<!-- EN-Revision: 1.5 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.119 --> <refentry id="function.array-key-exists"> <refnamediv> @@ -26,10 +26,12 @@ <title>esempio di <function>array_key_exists</function></title> <programlisting role="php"> <![CDATA[ +<?php $un_array = array("primo" => 1, "secondo" => 4); if (array_key_exists("primo", $un_array)) { echo "L'elemento 'primo' è nell'array"; -} + } + ?> ]]> </programlisting> </example> @@ -41,7 +43,9 @@ </simpara> </note> <para> - Vedere anche <function>isset</function>. + Vedere anche <function>isset</function>, + <function>array_keys</function> e + <function>in_array</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/array/functions/array-keys.xml diff -u phpdoc-it/reference/array/functions/array-keys.xml:1.3 phpdoc-it/reference/array/functions/array-keys.xml:1.4 --- phpdoc-it/reference/array/functions/array-keys.xml:1.3 Sun May 12 18:14:11 2002 +++ phpdoc-it/reference/array/functions/array-keys.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.11 --> <!-- last change to 'array-keys' in en/ tree in rev 1.2 --> -<!-- EN-Revision: 1.4 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.7 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.2 --> <refentry id="function.array-keys"> <refnamediv> @@ -31,19 +31,23 @@ <title>Esempio di <function>array_keys</function></title> <programlisting role="php"> <![CDATA[ +?php $array = array (0 => 100, "colore" => "rosso"); print_r(array_keys ($array)) $array = array ("blu", "rosso", "verde", "blu", "blu"); print_r(array_keys ($array, "blu")); -$array = array ("colore" => array("blu", "rosso", "verde"), "misura" =&gt; array("piccola", "media", "grande")); +$array = array ("colore" => array("blu", "rosso", "verde"), + "misura" =&gt; array("piccola", "media", "grande")); print_r(array_keys ($array)); +?> ]]> </programlisting> <para> Il risultato di questo programma sarà: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -62,38 +66,12 @@ [1] => misura ) ]]> - </screen> - </para> + </screen> </example> </para> - <note> - <para> - Questa funzione &egrave; stata aggiunta in PHP 4, qui sotto c'&egrave; una implementazione per - coloro che usano ancora PHP 3. - <example> - <title> - Implementazione di <function>array_keys</function> per utenti - PHP 3 - </title> - <programlisting role="php"> -<![CDATA[ -function array_keys ($arr, $term="") { - $t = array(); - while (list($k,$v) = each($arr)) { - if ($term && $v != $term) { - continue; - } - $t[] = $k; - } - return $t; -} -]]> - </programlisting> - </example> - </para> - </note> <para> - Vedere anche <function>array_values</function>. + Vedere anche <function>array_values</function> e + <function>array_key_exists</function>. </para> </refsect1> </refentry> Index: phpdoc-it/reference/array/functions/array-map.xml diff -u phpdoc-it/reference/array/functions/array-map.xml:1.5 phpdoc-it/reference/array/functions/array-map.xml:1.6 --- phpdoc-it/reference/array/functions/array-map.xml:1.5 Sun Feb 9 13:57:09 2003 +++ phpdoc-it/reference/array/functions/array-map.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.1 --> <!-- last change to 'array-map' in en/ tree in rev 1.62 --> -<!-- EN-Revision: 1.8 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.62 --> <refentry id="function.array-map"> <refnamediv> @@ -45,7 +45,8 @@ </programlisting> <para> In questo modo <varname>$b</varname> sarà: - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -56,8 +57,7 @@ [4] => 125 ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -87,7 +87,8 @@ </programlisting> <para> Questo restituisce: - <screen> + </para> + <screen> <![CDATA[ //stampa di $c Array @@ -129,8 +130,7 @@ ) ]]> - </screen> - </para> + </screen> </example> </para> <para> @@ -164,7 +164,8 @@ </para> <para> Il risultato di questo programma sarà; - <screen> + </para> + <screen> <![CDATA[ Array ( @@ -205,8 +206,7 @@ ) ]]> - </screen> - </para> + </screen> <para> Vedere anche <function>array_filter</function>, <function>array_reduce</function> e Index: phpdoc-it/reference/array/functions/array-merge-recursive.xml diff -u phpdoc-it/reference/array/functions/array-merge-recursive.xml:1.3 phpdoc-it/reference/array/functions/array-merge-recursive.xml:1.4 --- phpdoc-it/reference/array/functions/array-merge-recursive.xml:1.3 Sun May 12 18:14:11 2002 +++ phpdoc-it/reference/array/functions/array-merge-recursive.xml Sat Aug 9 07:22:00 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- splitted from ./it/functions/array.xml, last change in rev 1.6 --> <!-- last change to 'array-merge-recursive' in en/ tree in rev 1.12 --> -<!-- EN-Revision: 1.4 Maintainer: cucinato Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: cucinato Status: ready --> <!-- OLD-Revision: 1.173/EN.1.12 --> <refentry id="function.array-merge-recursive"> <refnamediv> @@ -34,14 +34,17 @@ <title>Esempio di <function>array_merge_recursive</function></title> <programlisting role="php"> <![CDATA[ +<?php $ar1 = array ("colore" => array ("preferito" => "rosso"), 5); $ar2 = array (10, "colore" => array ("preferito" => "verde", "blu")); $risultato = array_merge_recursive ($ar1, $ar2); +?> ]]> </programlisting> <para> La variabile <varname>$risultato</varname> sarà: - <screen role="php"> + </para> + <screen role="php"> <![CDATA[ Array ( @@ -60,8 +63,7 @@ [1] => 10 ) ]]> - </screen> - </para> + </screen> </example> </para> <para>
« previous php.doc.it (#453) next »