← All built-ins / count()
count()
count(mixed $v): int
Parameters
| Name | Type | Description |
|---|---|---|
| $v | array|string | array to count, or string to measure |
Return value
Element count of the array, byte length of the string.
Example
echo count([10, 20, 30]), " "; echo count(["a" => 1, "b" => 2]), " ";
3 2