array_count_values() definition and usage
array_count_values() function is used to count the number of occurrences of all values in an array.
This function returns an array, the key name of its element is the value of the original array, and the key value is the number of times the value appears in the original array.
Syntax
array_count_values(array) Parameter Description
array Required. Specifies the input array.
Example
Copy code The code is as follows:
$a=array("Cat","Dog","Horse","Dog");
print_r(array_count_values($a ));
?>
The above introduces the values php array function sequence array_count_values function that counts the number of occurrences of all values in the array, including the contents of values. I hope it will be helpful to friends who are interested in PHP tutorials.