Array count value
<?php $states = array("Ohio","Iowa","Arizona","Iowa","Ohio"); $stateFrequency = array_count_values($states); print_r($stateFrequency); ?>