What is the use of array_count_values() in php?
It is an inbuilt function in PHP. It is one of the most simple functions that is used to count all the values inside an array. In other words we can say that it is used to calculate the frequency of all of the elements of an array.
$array = array("B","Cat","Dog","B","Dog","Dog","Cat");
// OUTPUT : Array ( [B] => 2 [Cat] => 2 [Dog] => 3 )