note 8297 modified in array_unique by jmoore

From: Date: Tue, 05 Sep 2000 10:19:05 +0000
Subject: note 8297 modified in array_unique by jmoore
Groups: php.notes 
Request: Send a blank email to php-notes+get-4166@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

« previous php.notes (#4166) next »