array_count_values

Syntax:array array_count_values ( array $input )
Description:Counts all the values of an array

<?php
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));
?>

OUTPUT

<?php
Array ( 
[1] => 2 
[hello] => 2 
[world] => 1 
)