note 30649 added to function.array-diff
| From: | pieter3d at hotmail dot com | Date: | Tue, 25 Mar 2003 00:26:08 +0000 |
| Subject: | note 30649 added to function.array-diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45767@lists.php.net to get a copy of this message | ||
When executing this code:
$a = array(1,2,3,4,5,6,7,8,9);
$b = array(3,4,5);
$test=array_diff($a,$b);
$i=0;
while($test[$i])
{
echo "$test[$i]<br>";
$i++;
}
the result is:
1
2
The expected result of course is
1
2
6
7
8
9
bug perhaps?
--
http://www.php.net/manual/en/function.array-diff.php
http://master.php.net/manage/user-notes.php?action=edit+30649
http://master.php.net/manage/user-notes.php?action=delete+30649
http://master.php.net/manage/user-notes.php?action=reject+30649