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_shift(3) - php
array_merge_recursive(3) - php
array_reverse(3) - php
array(3) - php
array_fill(3) - php
Similar Topics in the Unix Linux Community
affect a exploded a string into an array
How to swap the values in array using for loop?
Count number of unique values in each column of array
Putting strings into positioning array in loop
Selection from array