array_count_values

It counts all the values of an array

Example

<?php
echo “<pre>”;
$array = array(PHP, “ASP”, PHP, “ASP”, “PHP”);
print_r(array_count_values($array));
?>

Output

Array
(
[PHP] => 3
[ASP] => 2
)

Share