php man page for array_count_values

Query: array_count_values

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ARRAY_COUNT_VALUES(3)							 1						     ARRAY_COUNT_VALUES(3)

array_count_values - Counts all the values of an array

SYNOPSIS
array array_count_values (array $array)
DESCRIPTION
array_count_values(3) returns an array using the values of $array as keys and their frequency in $array as values.
PARAMETERS
o $array - The array of values to count
RETURN VALUES
Returns an associative array of values from $array as keys and their count as value.
ERRORS
/EXCEPTIONS Throws E_WARNING for every element which is not string or integer.
EXAMPLES
Example #1 array_count_values(3) example <?php $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 )
SEE ALSO
count(3), array_unique(3), array_values(3), count_chars(3). PHP Documentation Group ARRAY_COUNT_VALUES(3)
Related Man Pages
array_keys(3) - php
array_fill(3) - php
array_combine(3) - php
array_product(3) - php
array_unique(3) - php
Similar Topics in the Unix Linux Community
affect a exploded a string into an array
how to read a var value into array
How to read values and store in array?
Storage Array not readable
Pointers and array