Re: getting number of unique values out of array

From: Date: Sun, 12 Sep 2004 18:00:31 +0000
Subject: Re: getting number of unique values out of array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-196454@lists.php.net to get a copy of this message
Merlin wrote:
Hi there, I am wondering how to count the number of unique values inside an array. For example, there is an array named country and it containes 3 country names, where Germany is doubled. So I would like to know that there are 2 unique country names in the array. Has anybody an idea how to achive that? Thanx for any help on that, Merlin just use
count(array_unique($array));

« previous php.general (#196454) next »