Returns the number of occurrences for each value in an array.
This function counts the number of occurrences of each element value in an array. The result is returned in the form of an array with the element values as keys, and the number of occurrences as values.
<pre>
<?php
$array1 = array(
"Paris" => "France",
"Rome" => "Italy",
"New York" => "USA",
"Los Angeles" => "USA");
$array1 = array_count_values($array1);
print_r($array1);
?>
</pre>
Array
(
[France] => 1
[Italy] => 1
[USA] => 2
)
This example shows how array_count_values() works.