$array = array('apple', 'orange', 'pear', 'banana', 'apple', 'pear', 'kiwi', 'kiwi', 'kiwi'); print_r(array_count_values($array));
Array ( [apple] => 2 [orange] => 1 [pear] => 2 etc... )