Definition and Usage
The sizeof() function returns the number of elements in an array.The sizeof() function is an alias of the count() function.
Syntax
sizeof(array,mode);
| Parameter | Description |
|---|---|
| array | Required. Specifies the array |
| mode | Optional. Specifies the mode. Possible values:
|
EXAMPLE :
<?php
$cars=array("Volvo","BMW","Toyota");
echo sizeof($cars);
?>
OUTPUT :
3