cvs: phpdoc /fr/functions array.xml

From: Date: Tue, 10 Jul 2001 07:17:42 +0000
Subject: cvs: phpdoc /fr/functions array.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969336050@lists.php.net to get a copy of this message
dams Tue Jul 10 03:17:42 2001 EDT Modified files: /phpdoc/fr/functions array.xml Log: Trouble with line 1208 and 929. Index: phpdoc/fr/functions/array.xml diff -u phpdoc/fr/functions/array.xml:1.35 phpdoc/fr/functions/array.xml:1.36 --- phpdoc/fr/functions/array.xml:1.35 Sat Jul 7 18:21:59 2001 +++ phpdoc/fr/functions/array.xml Tue Jul 10 03:17:42 2001 @@ -926,15 +926,15 @@ &eacute;l&eacute;ment du tableau <parameter>array</parameter>, le raccourcissant d'un &eacute;l&eacute;ment. Si <parameter>array</parameter> est vide, ou n'est pas un tableau, <function>array_pop</function> - retourne <varname>&null;</varname>. + retourne <literal>NULL</literal>. </para> <para> <example> <title>Exemple avec <function>array_pop</function></title> <programlisting role="php"> &lt;?php -$stack = array ("orange", "pomme", "framboise"); -$fruit = array_pop ($stack); + $stack = array("orange", "pomme", "framboise"); + $fruit = array_pop($stack); ?&gt; </programlisting> <para> @@ -1205,15 +1205,15 @@ tableau et la retourne, en raccourcissant le tableau d'un &eacute;l&eacute;ment, et en d&eacute;placant tous les &eacute;l&eacute;ments vers le bas. Si <parameter>array</parameter> est vide, ou n'est pas un tableau, - <function>array_shift</function> retourne <varname>&null;</varname>. + <function>array_shift</function> retourne <literal>NULL</literal>. </para> <para> <example> <title>Exemple avec <function>array_shift</function></title> <programlisting role="php"> &lt;?php -$args = array ("-v", "-f"); -$opt = array_shift ($args); + $args = array("-v", "-f"); + $opt = array_shift($args); ?&gt; </programlisting> </example> @@ -1223,7 +1223,7 @@ <para> Voir aussi <function>array_unshift</function>, - <function>array_push</function>, et + <function>array_push</function> et <function>array_pop</function>. <note> <para> @@ -1281,17 +1281,17 @@ <title>Exemple avec <function>array_slice</function></title> <programlisting role="php"> &lt;?php -$input = array("a", "b", "c", "d", "e"); -$output = array_slice($input, 2); // retourne "c", "d", et "e" + $input = array("a", "b", "c", "d", "e"); + $output = array_slice($input, 2); // retourne "c", "d", et "e" // les trois exemples suivants sont &eacute;quivalents -$output = array_slice($input, 2, 2); // retourne "c", "d" -$output = array_slice($input, 2, -1); // retourne "c", "d" + $output = array_slice($input, 2, 2); // retourne "c", "d" + $output = array_slice($input, 2, -1); // retourne "c", "d" // Equivalent &agrave; : -$offset = 2; $length = -1; -$output = array_slice($input, 2, count($input) - $offset + $length); + $offset = 2; $length = -1; + $output = array_slice($input, 2, count($input) - $offset + $length); // retourne "c", "d" -$output = array_slice($input, -2, 1); // retourne "d" -$output = array_slice($input, 0, 3); // retourne "a", "b", et "c" + $output = array_slice($input, -2, 1); // retourne "d" + $output = array_slice($input, 0, 3); // retourne "a", "b", et "c" ?&gt; </programlisting> </example> @@ -1376,11 +1376,11 @@ Les codes suivants sont &eacute;quivalents : <programlisting role="php"> &lt;?php -array_push($input, $x, $y) array_splice($input, count($input), 0, array($x, $y)) -array_pop($input) array_splice($input, -1) -array_shift($input) array_splice($input, 0, 1) -array_unshift($input, $x, $y) array_splice($input, 0, 0, array($x, $y)) -$a[$x] = $y array_splice($input, $x, 1, $y) + array_push($input, $x, $y) array_splice($input, count($input), 0, array($x, $y)) + array_pop($input) array_splice($input, -1) + array_shift($input) array_splice($input, 0, 1) + array_unshift($input, $x, $y) array_splice($input, 0, 0, array($x, $y)) + $a[$x] = $y array_splice($input, $x, 1, $y) ?&gt; </programlisting> </para> @@ -1394,20 +1394,20 @@ <programlisting role="php"> &lt;?php // cas simple -$input = array("rouge", "vert", "bleu", "jaune"); -array_splice($input, 2); + $input = array("rouge", "vert", "bleu", "jaune"); + array_splice($input, 2); // $input est array("rouge", "vert") // nombre d'&eacute;l&eacute;ments n&eacute;gatif -$input = array("rouge", "vert", "bleu", "jaune"); -array_splice($input, 1, -1); + $input = array("rouge", "vert", "bleu", "jaune"); + array_splice($input, 1, -1); // $input est array("rouge", "jaune") // avec un &eacute;l&eacute;ment de remplacement -$input = array("rouge", "vert", "bleu", "jaune"); -array_splice($input, 1, count($input), "orange"); + $input = array("rouge", "vert", "bleu", "jaune"); + array_splice($input, 1, count($input), "orange"); // $input est array("rouge", "orange") // cas complexe -$input = array("rouge", "vert", "bleu", "jaune"); -array_splice($input, -1, 1, array("noir", "marron")); + $input = array("rouge", "vert", "bleu", "jaune"); + array_splice($input, -1, 1, array("noir", "marron")); // $input est array("rouge", "vert", // "bleu", "noir", "marron") ?&gt; @@ -1451,11 +1451,11 @@ <title>Exemple avec <function>array_sum</function></title> <programlisting role="php"> &lt;?php -$a = array(2,4,6,8); -echo "somme(a) = ".array_sum($a)."\n"; + $a = array(2,4,6,8); + echo "somme(a) = ".array_sum($a)."\n"; // affiche : somme(a) = 20 -$b = array("a"=>1.2,"b"=>2.3,"c"=>3.4); -echo "somme(b) = ".array_sum($b)."\n"; + $b = array("a"=>1.2,"b"=>2.3,"c"=>3.4); + echo "somme(b) = ".array_sum($b)."\n"; // affiche : somme(b) = 6.9 ?&gt; </programlisting> @@ -1487,8 +1487,8 @@ <title>Exemple avec <function>array_unique</function></title> <programlisting role="php"> &lt;?php -$input = array ("a" =&gt; "vert", "rouge", "b" =&gt; "vert", "bleu", "rouge"); -$result = array_unique ($input); + $input = array("a" =&gt; "vert", "rouge", "b" =&gt; "vert", "bleu", "rouge"); + $result = array_unique($input); ?&gt; </programlisting> </example> @@ -3141,12 +3141,12 @@ &lt;?php function cmp($a,$b) { if ($a == $b) return 0; - return ($a &gt; $b) ? -1 : 1; + return ($a &lt; $b) ? -1 : 1; } -$a = array(3,2,5,6,1); +$tableau = array(3,2,5,6,1); usort($a, "cmp"); -while(list($key,$value) = each($a)) { - echo "$key: $value\n"; +while(list($cle,$valeur) = each($tableau)) { + echo "$cle: $valeur\n"; } ?&gt; </programlisting>

« previous php.doc (#969336050) next »