Their is function called "array_count_values()" which will count all the values of an array.
Lets suppose we have an array **array("A","Cat","Dog","A","Dog");** and we want to count the values of an array.
Example :
<!DOCTYPE html>
<html>
<body>
<?php
$a=array("A","Cat","Dog","A","Dog");
print_r(array_count_values($a));
?>
</body>
</html>
Output:
Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
0 Comment(s)