← All docs

array_count_values()

Counts the occurrences of each distinct value in an array.

array_count_values()

function array_count_values(array $array): array

Counts the occurrences of each distinct value in an array.

Parameters:

  • $array (array)

Returns: array

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how array_count_values is implemented in the compiler, see the internals page.