Definiton:
The count()
function count all elements in an array, or something in an object.
The basic syntax of the count()
function is given with:
count(array, mode);
Parameter | Description |
---|---|
array | Required. Specifies the array |
mode | Optional. Specifies the mode. Possible values:
|
Example1 : we can see below example return the number no elements an array
Output : 3
Example2 : Count the array recursively
Output : Normal count : 3
Recursive count : 8