Easy Tutorial
❮ Func String Substr Count Php Use Statement ❯

PHP sizeof() Function

Complete PHP Array Reference Manual

Example

Returns the number of elements in the array:


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

Parameter Description
array Required. Specifies the array to count.
mode Optional. Specifies the mode of the function. Possible values: 0 - Default. Does not count all elements in a multidimensional array.<br>1 - Recursively counts the number of elements in the array (counts all elements in a multidimensional array).

Technical Details

Return Value: Returns the number of elements in the array.
PHP Version: 4+
--- ---

More Examples

Example 1

Recursively counts the number of elements in the array:


❮ Func String Substr Count Php Use Statement ❯