We have two functions to get the number of elements in an array ie count() and sizeof()
Syntax : count ($array) and sizeof($array)
<?php
$a[0] = 15;
$a[1] = 12;
$a[2] = 50;
$a[3] = 41;
$a[4] = 42;
echo $result = count($a);
?>
OUTPUT: 4
We have two functions to get the number of elements in an array ie count() and sizeof()
Syntax : count ($array) and sizeof($array)
$a[0] = 15;
$a[1] = 12;
$a[2] = 50;
$a[3] = 41;
$a[4] = 42;
echo $result = count($a);
OUTPUT: 4