note 8176 deleted from function.array-diff by didou
| From: | didou@php.net | Date: | Wed, 03 Dec 2003 11:27:39 +0000 |
| Subject: | note 8176 deleted from function.array-diff by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61326@lists.php.net to get a copy of this message | ||
Note Submitter: ks@ksweb.de
----
'preserved' means the keys are taken from the first accurence of the elements.
The example is wrong:
$array1 = array ("a" => "green", "red", "blue");
$array2 = array ("b" => "green", "yellow", "red");
$result = array_diff ($array1, $array2);
print_r($result);
$your_result=array("blue");
print_r($your_result);
outputs:
Array ( [1] => blue ) Array ( [0] => blue )
the correct Array-Statement of $result is:
$result=array("","blue");