counting array elements

From: Date: Mon, 24 Feb 2003 08:12:23 +0000
Subject: counting array elements
Groups: php.general 
Request: Send a blank email to php-general+get-136853@lists.php.net to get a copy of this message
Hi all, I wish to fine the most occurringest value in an array. eg: $arr = array('dog', 'cat', 'dog', 'zebra', 'cat', 'dog', 'dog', 'dog'); if I use array_count_values it gives "dog => 5" I would like to get 'dog' and '5' into a $variable. Kind regards Kevin -- ______ (_____ \ _____) ) ____ ____ ____ ____ | ____/ / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \____) \_||_| \____) \____) Kevin Waterson Port Macquarie, Australia

« previous php.general (#136853) next »