note 37520 added to function.array-diff
| From: | bbyrne at mediareform dot net | Date: | Tue, 18 Nov 2003 17:54:00 +0000 |
| Subject: | note 37520 added to function.array-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60578@lists.php.net to get a copy of this message | ||
The manual makes two statements regarding this function, and one of them is incorrect.
<B>array_diff -- Computes the difference of arrays</B>
That's true. The function returns an array containing all the elements that do not appear in
the arrays used as arguments.
<B>array_diff() returns an array containing all the values of array1 that are not present
in any of the other arguments.</B>
This is *not true.* array_diff returns an array containing all the values OF ALL THE ARRAYS that are
not present inany of the other arguments.
At least, that's how 4.3.2 is behaving on my machine right now. I tried supplying array3 as the
same as array2, to weed out the values in array2 I didn't want the function returning, but to
no avail.
----
Manual Page -- http://www.php.net/manual/en/function.array-diff.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37520
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37520&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37520&report=yes
Search -- http://master.php.net/manage/user-notes.php