PHP Function to find out the number of occurrence elements in an array -PHP May 11, 2011 Pramod T P Leave a comment <?php $testArray=array("Value1","Value1","Value1","Value2"); print_r(array_count_values($testArray)); //Array ( [Value1] => 3 [Value2] => 1 ) ?>