PHP sizeof() Function

The sizeof() function is used to count the elements of an array or the properties of an object. This function is an alias of count().

The sizeof() function is an alias of the count() function.

Returns the number of elements in the array

ParameterDescription
arrayRequired. Specifies the array
modeOptional. Specifies the mode. Possible values:

Syntax

sizeof(array,mode); 

Example

$name=array("Alex","Prince","Samule");
echo sizeof($name);

Output

3

Leave a Reply

Your email address will not be published. Required fields are marked *