|
|
Php Array sizeof Function
|
Tutorials » Php »
|
Topic |
What is sizeof Function?
|
|
Explanation |
|
The "size of" function is the alias of count() function.
Syntax:
sizeof(array1,array2)
In the above syntax "array" is the array to count, there is a parameter "mode" which can have "0" by default doesnt
detect a multi dimensional array, if "1" is selected will detect the length of multi dimensional array.
Example
<?php
$b=array("Grapes", "Apple", "Cherry");
$a=sizeof($b);
print_r($a);
?>
Result:
3
In the above example the size of the array "$b" is displayed as "4".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|