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 arraySYNOPSISarray array_count_values (array $array)DESCRIPTIONarray_count_values(3) returns an array using the values of $array as keys and their frequency in $array as values.PARAMETERSo $array - The array of values to countRETURN VALUESReturns 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.EXAMPLESExample #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 ALSOcount(3), array_unique(3), array_values(3), count_chars(3). PHP Documentation Group ARRAY_COUNT_VALUES(3)
| Related Man Pages |
|---|
| array_merge_recursive(3) - php |
| array_count_values(3) - php |
| array_reduce(3) - php |
| array_intersect(3) - php |
| array_product(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| Rotate an array |
| Storage Array not readable |
| 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 |