Count array values

This example counts the values in an array using the array_count_values function

<?php
   $search = array(“google”,”yahoo”,”live”,”google”,”yahoo”,”google”);
   $frequency = array_count_values($search);
   print_r($frequency);
?>

LEAVE A REPLY

Please enter your comment!
Please enter your name here

*