$c = array_count_values($stuff); $val = array_search(max($c), $c);
Use array_count_values and get the key of the item:
array_count_values
<?php$stuff = array('orange','banana', 'apples','orange', 'xxxxxxx');$result = array_count_values($stuff);asort($result);end($result);$answer = key($result);echo $answer;?>
Output:
orange