This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Arrays

array_count_values() Function

Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )

<?php
// the array to count the values of
$a=array("A","Cat","Dog","A","Dog");

// count the values of the array and display the results
print_r(array_count_values($a));
?>