Menu Riverview Church

ARRAY_COUNT_VALUES

Counts all the values of an array

SYNTAX

array_count_values ( array $array ) : array

PARAMETERS

array

The array of values to count

RETURN

Returns an associative array of values from array as keys and their count as value.

EXAMPLES

1

Array
(
    [0] => 3
    [1] => 2
    [2] => 1
)

2

Array
(
    [a] => 3
    [b] => 2
    [c] => 1
)

PHP