➤ The array_count_values() function counts all the values of an array. Syntax:
array_count_values(array)
For instance:
$animals = array(
	"Cat",
	"Cat",
	"Dog",
	"Rabbit",
	"Rabbit",
	"Dog",
	"Dog",
	"Dog",
	"Cat",
	);
print_r (array_count_values($animals));
/* outputs: 
Array
(
    [Cat] => 3
    [Dog] => 4
    [Rabbit] => 2
)
*/
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences