Organizational Research By

Surprising Reserch Topic

array_count_values — Counts all the values of an array


array_count_values() returns an array using the values of array as keys and their frequency in array as values.


asked May 25, 2015 in PHP by rahulgii
0 votes
26 views



Related Hot Questions

1 Answer

0 votes
array_count_values() example

$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));
?>
The above example will output:

Array
(
    [1] => 2
    [hello] => 2
    [world] => 1
)
answered May 25, 2015 by rahulgii

...