I was here just a while ago, I got this piece of code from someone who replied to someone else's question.
"There is a function to count the number of every value in an array. For example if $input was the array 1, dog, 2, 2, dog, 2, 3, 3, 4, 5, dog, 2, 5 then:
$counts = function...