array_diff
| From: | Angelo Zanetti | Date: | Thu, 02 Oct 2003 08:44:15 +0000 |
| Subject: | array_diff | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-164706@lists.php.net to get a copy of this message | ||
Hi all,
I am getting some weird results when using the array_diff() function.
eg: $arrayResult = array_diff($array1, $array2);
When i use it the resulting array ($arrayResult) gets the correct number of
elements, however when I echo the elements in $arrayResult it contains some
blank values.
eg:
$array1 = [123] [120] [44] [54]
$array2 = [120] [54]
then when I display $arrayResult:
[123] ... -> blank value which should be 44.
According to the manual : "Array_diff() returns an array containing all the
values of array1 that are not present in any of the other arguments"
it should return [123] and [44]. What is the reason for it being blank??
Angelo Zanetti
Cell No: +27 72 441 3355
Tel No: +27 21 464 1363
Fax No: +27 21 464 1371
e-Mail: angelo@zlogic.co.za
Z Logic
e-Business Centre
Cape Technikon
P.O. BOX 652
Cape Town
South Africa
8000