array_count_values(array)
For instance:
$animals = array(
"Cat",
"Cat",
"Dog",
"Rabbit",
"Rabbit",
"Dog",
"Dog",
"Dog",
"Cat",
);
print_r (array_count_values($animals));
/* outputs:
Array
(
[Cat] => 3
[Dog] => 4
[Rabbit] => 2
)
*/