note 10147 added to array_diff
| From: | jllamas at bal dot com dot mx | Date: | Fri, 15 Dec 2000 16:17:43 +0000 |
| Subject: | note 10147 added to array_diff | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8759@lists.php.net to get a copy of this message | ||
To umer@ezboard.com, the same problem ocurrs with array_unique. Try this solution provided by
matthew_dean@hotmail.com. Use
array_values(array_unique($myArray));
or you can also use the one suggested by burno@33-24-36.com (I haven't tested it myself).
usort($myArray,"return -1");
I think this problem is present on all array functions, but will only be noticed with numerically
indexed arrays.
http://www.php.net/manual/function.array-diff.php