note 8297 modified in function.array-unique by vrana

From: Date: Tue, 17 Aug 2004 14:51:34 +0000
Subject: note 8297 modified in function.array-unique by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79717@lists.php.net to get a copy of this message
Maybe this will come handy for PHP3 users: <?php 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. --was-- 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://php.net/manual/en/function.array-unique.php

« previous php.notes (#79717) next »