PHP count[] Function
PHP Array Reference
Example
Return the number of elements in an array:
Definition and Usage
The count[] function returns the number of elements in an array.
Syntax
count[array, mode]
Parameter Values
array | Required. Specifies the array |
mode | Optional. Specifies the mode. Possible values:
|
Technical Details
Returns the number of elements in the array |
4+ |
The mode parameter was added in PHP 4.2 |
More Examples
Example
Count the array recursively: