Easy Tutorial
❮ Func Filesystem Stat Php Remove Sapi ❯

PHP array_count_values() Function

Complete PHP Array Reference Manual

Example

Count the occurrences of each value in an array:


Definition and Usage

The array_count_values() function is used to count the occurrences of each value in an array.


Syntax

Parameter Description
array Required. Specifies the array for which to count the occurrences of each value.

Technical Details

Return Value: Returns an associative array where the keys are the values from the original array and the values are the counts of those values in the original array.
PHP Version: 4+
--- ---
❮ Func Filesystem Stat Php Remove Sapi ❯