[PHP-DOC] cvs: phpdoc /en/functions array.xml From: Jesus M. Castagnetto (jesusmc <email protected>)
Date: 09/08/00

jmcastagnetto Fri Sep 8 12:34:56 2000 EDT

  Modified files:
    /phpdoc/en/functions array.xml
  Log:
  Fixed typo in the code I just modified, and also did a search and replace
  of all the => and -> to use the &gt; entity instead.
  
  
Index: phpdoc/en/functions/array.xml
diff -u phpdoc/en/functions/array.xml:1.36 phpdoc/en/functions/array.xml:1.37
--- phpdoc/en/functions/array.xml:1.36 Fri Sep 8 12:27:11 2000
+++ phpdoc/en/functions/array.xml Fri Sep 8 12:34:56 2000
@@ -53,9 +53,9 @@
       <title><function>Array</function> example</title>
       <programlisting role="php">
 $fruits = array (
- "fruits" => array ("a"=>"orange", "b"=>"banana", "c"=>"apple"),
- "numbers" => array (1, 2, 3, 4, 5, 6),
- "holes" => array ("first", 5 => "second", "third")
+ "fruits" =&gt; array ("a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple"),
+ "numbers" =&gt; array (1, 2, 3, 4, 5, 6),
+ "holes" =&gt; array ("first", 5 =&gt; "second", "third")
 );
       </programlisting>
      </example>
@@ -89,7 +89,7 @@
       <title><function>Array_count_values</function> example</title>
       <programlisting role="php">
 $array = array (1, "hello", 1, "world", "hello");
-array_count_values ($array); // returns array (1=>2, "hello"=>2, "world"=>1)
+array_count_values ($array); // returns array (1=&gt;2, "hello"=&gt;2, "world"=&gt;1)
       </programlisting>
      </example>
     </para>
@@ -123,8 +123,8 @@
      <example>
       <title><function>Array_diff</function> example</title>
       <programlisting role="php">
-$array1 = array ("a" => "green", "red", "blue");
-$array2 = array ("b" => "green", "yellow", "red");
+$array1 = array ("a" =&gt; "green", "red", "blue");
+$array2 = array ("b" =&gt; "green", "yellow", "red");
 $result = array_diff ($array1, $array2);
       </programlisting>
      </example>
@@ -194,15 +194,15 @@
      <example>
       <title><function>Array_intersect</function> example</title>
       <programlisting role="php">
-$array1 = array ("a" => "green", "red", "blue");
-$array2 = array ("b" => "green", "yellow", "red");
+$array1 = array ("a" =&gt; "green", "red", "blue");
+$array2 = array ("b" =&gt; "green", "yellow", "red");
 $result = array_intersect ($array1, $array2);
       </programlisting>
      </example>
     </para>
     <para>
      This makes <varname>$result</varname> have <literal>array ("a"
- => "green", "red");</literal>
+ =&gt; "green", "red");</literal>
     </para>
     <para>
      See also <function>array_diff</function>.
@@ -241,7 +241,7 @@
      <example>
       <title><function>Array_keys</function> example</title>
       <programlisting role="php">
-$array = array (0 => 100, "color" => "red");
+$array = array (0 =&gt; 100, "color" =&gt; "red");
 array_keys ($array); // returns array (0, "color")
 
 $array = array ("blue", "red", "green", "blue", "blue");
@@ -262,7 +262,7 @@
 function array_keys($arr, $term="") {
         $t = array();
         while (list($k,$v) = each($arr)) {
- if ($term &amp;&amp; $k != $term)
+ if ($term &amp;&amp; $v != $term)
                         continue;
                 $t[] = $k;
         }
@@ -310,15 +310,15 @@
      <example>
       <title><function>array_merge</function> example</title>
       <programlisting role="php">
-$array1 = array ("color" => "red", 2, 4);
-$array2 = array ("a", "b", "color" => "green", "shape" => "trapezoid", 4);
+$array1 = array ("color" =&gt; "red", 2, 4);
+$array2 = array ("a", "b", "color" =&gt; "green", "shape" =&gt; "trapezoid", 4);
 array_merge ($array1, $array2);
       </programlisting>
      </example>
     </para>
     <para>
- Resulting array will be <literal>array("color" => "green", 2, 4,
- "a", "b", "shape" => "trapezoid", 4)</literal>.
+ Resulting array will be <literal>array("color" =&gt; "green", 2, 4,
+ "a", "b", "shape" =&gt; "trapezoid", 4)</literal>.
     </para>
     <para>
      See also <function>array_merge_recursive</function>.
@@ -360,15 +360,15 @@
      <example>
       <title><function>Array_merge_recursive</function> example</title>
       <programlisting role="php">
-$ar1 = array ("color" => array ("favorite" => "red"), 5);
-$ar2 = array (10, "color" => array ("favorite" => "green", "blue"));
+$ar1 = array ("color" =&gt; array ("favorite" =&gt; "red"), 5);
+$ar2 = array (10, "color" =&gt; array ("favorite" =&gt; "green", "blue"));
 $result = array_merge_recursive ($ar1, $ar2);
       </programlisting>
      </example>
     </para>
     <para>
- Resulting array will be <literal>array ("color" => array
- ("favorite" => array ("red", "green"), "blue"), 5, 10)</literal>.
+ Resulting array will be <literal>array ("color" =&gt; array
+ ("favorite" =&gt; array ("red", "green"), "blue"), 5, 10)</literal>.
     </para>
     <para>
      See also <function>array_merge</function>.
@@ -937,13 +937,13 @@
      <example>
       <title><function>Array_unique</function> example</title>
       <programlisting role="php">
-$input = array ("a" => "green", "red", "b" => "green", "blue", "red");
+$input = array ("a" =&gt; "green", "red", "b" =&gt; "green", "blue", "red");
 $result = array_unique ($input);
       </programlisting>
      </example>
     </para>
     <para>
- This makes <varname>$result</varname> have <literal>array ("a" =>
+ This makes <varname>$result</varname> have <literal>array ("a" =&gt;
      "green", "red", "blue");</literal>.
     </para>
    </refsect1>
@@ -1022,7 +1022,7 @@
      <example>
       <title><function>Array_values</function> example</title>
       <programlisting role="php">
-$array = array ("size" => "XL", "color" => "gold");
+$array = array ("size" =&gt; "XL", "color" =&gt; "gold");
 array_values ($array); // returns array ("XL", "gold")
       </programlisting>
      </example>
@@ -1108,7 +1108,7 @@
      <example>
       <title><function>Array_walk</function> example</title>
       <programlisting role="php">
-$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");
 
 function test_alter (&amp;$item1, $key, $prefix) {
    $item1 = "$prefix: $item1";
@@ -1158,7 +1158,7 @@
      <example>
       <title><function>Arsort</function> example</title>
       <programlisting role="php">
-$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");
 arsort ($fruits);
 reset ($fruits);
 while (list ($key, $val) = each ($fruits)) {
@@ -1218,7 +1218,7 @@
      <example>
       <title><function>Asort</function> example</title>
       <programlisting role="php">
-$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");
 asort ($fruits);
 reset ($fruits);
 while (list ($key, $val) = each ($fruits)) {
@@ -1303,7 +1303,7 @@
       </programlisting>
       <para>
        After this, <varname>$result</varname> will be <literal>array ("event"
- => "SIGGRAPH", "city" => "San Francisco", "state" => "CA")</literal>.
+ =&gt; "SIGGRAPH", "city" =&gt; "San Francisco", "state" =&gt; "CA")</literal>.
       </para>
      </example>
     </para>
@@ -1437,13 +1437,13 @@
        <varname>$bar</varname> now contains the following key/value
        pairs:
        <itemizedlist spacing="compact">
- <listitem><simpara>0 => 0</simpara></listitem>
- <listitem><simpara>1 => 'bob'</simpara></listitem>
- <listitem><simpara>key => 0</simpara></listitem>
- <listitem><simpara>value => 'bob'</simpara></listitem>
+ <listitem><simpara>0 =&gt; 0</simpara></listitem>
+ <listitem><simpara>1 =&gt; 'bob'</simpara></listitem>
+ <listitem><simpara>key =&gt; 0</simpara></listitem>
+ <listitem><simpara>value =&gt; 'bob'</simpara></listitem>
        </itemizedlist>
        <programlisting role="php">
-$foo = array ("Robert" => "Bob", "Seppo" => "Sepi");
+$foo = array ("Robert" =&gt; "Bob", "Seppo" =&gt; "Sepi");
 $bar = each ($foo);
        </programlisting>
       </para>
@@ -1451,10 +1451,10 @@
        <varname>$bar</varname> now contains the following key/value
        pairs:
        <itemizedlist spacing="compact">
- <listitem><simpara>0 => 'Robert'</simpara></listitem>
- <listitem><simpara>1 => 'Bob'</simpara></listitem>
- <listitem><simpara>key => 'Robert'</simpara></listitem>
- <listitem><simpara>value => 'Bob'</simpara></listitem>
+ <listitem><simpara>0 =&gt; 'Robert'</simpara></listitem>
+ <listitem><simpara>1 =&gt; 'Bob'</simpara></listitem>
+ <listitem><simpara>key =&gt; 'Robert'</simpara></listitem>
+ <listitem><simpara>value =&gt; 'Bob'</simpara></listitem>
        </itemizedlist>
       </para>
      </example>
@@ -1472,7 +1472,7 @@
 echo "Values submitted via POST method:&lt;br&gt;";
 reset ($HTTP_POST_VARS);
 while (list ($key, $val) = each ($HTTP_POST_VARS)) {
- echo "$key => $val&lt;br&gt;";
+ echo "$key =&gt; $val&lt;br&gt;";
 }
       </programlisting>
      </example>
@@ -1617,9 +1617,9 @@
    wddx_deserialize */
 
 $size = "large";
-$var_array = array ("color" => "blue",
- "size" => "medium",
- "shape" => "sphere");
+$var_array = array ("color" =&gt; "blue",
+ "size" =&gt; "medium",
+ "shape" =&gt; "sphere");
 extract ($var_array, EXTR_PREFIX_SAME, "wddx");
 
 print "$color, $size, $shape, $wddx_size\n";
@@ -1725,11 +1725,11 @@
      <example>
       <title><function>Krsort</function> example</title>
       <programlisting role="php">
-$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");
 krsort ($fruits);
 reset ($fruits);
 while (list ($key, $val) = each ($fruits)) {
- echo "$key -> $val\n";
+ echo "$key -&gt; $val\n";
 }
       </programlisting>
      </example>
@@ -1782,11 +1782,11 @@
      <example>
       <title><function>Ksort</function> example</title>
       <programlisting role="php">
-$fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
+$fruits = array ("d"=&gt;"lemon", "a"=&gt;"orange", "b"=&gt;"banana", "c"=&gt;"apple");
 ksort ($fruits);
 reset ($fruits);
 while (list ($key, $val) = each ($fruits)) {
- echo "$key -> $val\n";
+ echo "$key -&gt; $val\n";
 }
       </programlisting>
      </example>
@@ -1914,19 +1914,19 @@
 Standard sorting
 Array
 (
- [0] => img1.png
- [1] => img10.png
- [2] => img12.png
- [3] => img2.png
+ [0] =&gt; img1.png
+ [1] =&gt; img10.png
+ [2] =&gt; img12.png
+ [3] =&gt; img2.png
 )
 
 Natural order sorting
 Array
 (
- [3] => img1.png
- [2] => img2.png
- [1] => img10.png
- [0] => img12.png
+ [3] =&gt; img1.png
+ [2] =&gt; img2.png
+ [1] =&gt; img10.png
+ [0] =&gt; img12.png
 )
       </programlisting>
      </informalexample>
@@ -2172,7 +2172,7 @@
 rsort ($fruits);
 reset ($fruits);
 while (list ($key, $val) = each ($fruits)) {
- echo "$key -> $val\n";
+ echo "$key -&gt; $val\n";
 }
       </programlisting>
      </example>
@@ -2412,7 +2412,7 @@
     return ($a > $b) ? -1 : 1;
 }
 
-$a = array (4 => "four", 3 => "three", 20 => "twenty", 10 => "ten");
+$a = array (4 =&gt; "four", 3 =&gt; "three", 20 =&gt; "twenty", 10 =&gt; "ten");
 
 uksort ($a, "cmp");