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 @@
élément du tableau <parameter>array</parameter>, le
raccourcissant d'un élé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">
<?php
-$stack = array ("orange", "pomme", "framboise");
-$fruit = array_pop ($stack);
+ $stack = array("orange", "pomme", "framboise");
+ $fruit = array_pop($stack);
?>
</programlisting>
<para>
@@ -1205,15 +1205,15 @@
tableau et la retourne, en raccourcissant le tableau d'un élément,
et en déplacant tous les élé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">
<?php
-$args = array ("-v", "-f");
-$opt = array_shift ($args);
+ $args = array("-v", "-f");
+ $opt = array_shift($args);
?>
</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">
<?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 é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 à :
-$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"
?>
</programlisting>
</example>
@@ -1376,11 +1376,11 @@
Les codes suivants sont équivalents :
<programlisting role="php">
<?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)
?>
</programlisting>
</para>
@@ -1394,20 +1394,20 @@
<programlisting role="php">
<?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'éléments né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 élé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")
?>
@@ -1451,11 +1451,11 @@
<title>Exemple avec <function>array_sum</function></title>
<programlisting role="php">
<?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
?>
</programlisting>
@@ -1487,8 +1487,8 @@
<title>Exemple avec <function>array_unique</function></title>
<programlisting role="php">
<?php
-$input = array ("a" => "vert", "rouge", "b" => "vert", "bleu", "rouge");
-$result = array_unique ($input);
+ $input = array("a" => "vert", "rouge", "b" => "vert", "bleu", "rouge");
+ $result = array_unique($input);
?>
</programlisting>
</example>
@@ -3141,12 +3141,12 @@
<?php
function cmp($a,$b) {
if ($a == $b) return 0;
- return ($a > $b) ? -1 : 1;
+ return ($a < $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";
}
?>
</programlisting>