I cut and pasted your code and it worked fine for me with PHP 4.3.0 (assuming the first line is really $dayarray = array(9,22,22); )
---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > -----Original Message----- > From: Greg Robillard [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 05, 2003 10:27 PM > To: [EMAIL PROTECTED] > Subject: [PHP] array_unique wierdness > > I would like to remove duplicate array values, and I > presume that array_unique should do this, but the > results are not what I am expecting > Anyone see this before: > $dayarray=(9,22,22); > $duparray = array_unique($dayarray); > $darray = count($duparray); > for($d=0;$d<$darray;$d++){ > echo "$d: ".$duparray[$d]."<br>"; > } > ## returns: > 0: 9 > 1: > rather than > 0: 9 > 1: 22 > > Is that what it is supposed to do? Does array_unique > remove all instances of duplicate values? > If so, is there a way to remove every instance but the > first? > Thanks, > > gr > > > > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Tax Center - File online, calculators, forms, and more > http://tax.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php