note 8297 modified in array_unique by zak
| From: | zak@php.net | Date: | Thu, 21 Dec 2000 18:31:23 +0000 |
| Subject: | note 8297 modified in array_unique by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-9000@lists.php.net to get a copy of this message | ||
Maybe this will come handy for PHP3 users:
for ($a = 0; $a < $arraylength; $a++){
if (($a > 0)&&($array[$a] <> $array[$a-1]))
$uniquearray[$a] = $array[$a];
$a++;
}
You can even skip the $a>0 test, I believe... not bulletproof, but much shorter.
http://www.php.net/manual/function.array-unique.php