note 9893 added to array_diff
| From: | umer at ezboard dot com | Date: | Thu, 30 Nov 2000 01:16:59 +0000 |
| Subject: | note 9893 added to array_diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8284@lists.php.net to get a copy of this message | ||
when you are comparing
array1 = array ("blue", "red", "green", "yellow");
array2 = array ("blue", "orange", "white", "yellow",
"black");
$result = array_diff($array2, $array1);
you get back
$result[0] = "";
$result[1] = "orange";
$result[2] = "white";
$result[3] = "";
$result[4] = "black";
odd huh.. and if you are depending on seeing if you got any thing back from both arrays.. then the
best thing to do is to count($result); and go from there..
http://www.php.net/manual/function.array-diff.php