Core Function CountValues

From Sputnik Wiki
Revision as of 10:01, 31 August 2013 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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
}
*/
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox