Fixed bug in example, and added note about key preservation for

array_unique, array_diff and array_intersect.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@29903 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stig Venaas 2000-08-08 18:59:22 +00:00
parent a1ef6ebcd6
commit 7ccd9f4d98

View file

@ -104,6 +104,7 @@ array_count_values ($array); // returns array (1=>2, "hello"=>2, "world"=>1)
<function>Array_diff</function> returns an array
containing all the values of <parameter>array1</parameter>
that are not present in any of the other arguments.
Note that keys are preserved.
</para>
<para>
<example>
@ -111,7 +112,7 @@ array_count_values ($array); // returns array (1=>2, "hello"=>2, "world"=>1)
<programlisting role="php">
$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");
$result = array_intersect ($array1, $array2);
$result = array_diff ($array1, $array2);
</programlisting>
</example>
</para>
@ -174,6 +175,7 @@ $original = strtr ($str, $trans);
<function>Array_intersect</function> returns an array
containing all the values of <parameter>array1</parameter>
that are present in all the arguments.
Note that keys are preserved.
</para>
<para>
<example>
@ -893,6 +895,7 @@ array_splice ($input, -1, 1, array("black", "maroon"));
<function>Array_unique</function> takes input
<parameter>array</parameter> and returns a new array
without duplicate values.
Note that keys are preserved.
</para>
<para>
<example>