php array length

Posted by Paidboom - 1 year ago

php array length : How to Count All Elements or Values in an Array in PHP? The sizeof() function is a builtin function in PHP and is used to count the number of elements present in an array or any other countable object.

<?php
$gods= array("ram", "syam", "krishna", "Shiva", "Hanuman", "vishnu", "Brahma");

// Printing array size
echo count($gods);
echo "<br>";
echo sizeof($gods);
?>