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));

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to