Core Function CountValues
From Sputnik Wiki
CountValues( <array> )
Contents |
Description
Counts all the values of an array.
Returns an array using the values of the input array as keys and their frequency in input as values.
Parameters
array
The array to use.
Return Value
Success: new array
Failure: empty array
Remarks
None.
Example
$array = array(1, "hello", 1, "world", "hello"); printr(CountValues($array)); /* // Prints ARRAY { [1] => 2 [hello] => 2 [world] => 1 } */