PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular

array_count_values

Tags: PHP 5.x PHP 7.x PHP 8.x

array_count_values — Counts all the values of an array.

Description

array_count_values(
    array $array
): array
array_count_values() returns an array using the values of array as keys and their frequency in array as values.

Parameters

array
The array of values to count

Return Values

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