xxxxxxxxxx
<?php
$names = array("Ankur","Raj","Ram","Suresh");
echo count($names);
$cars=array("Volvo","BMW","Toyota");
echo count($cars);
// test
xxxxxxxxxx
// https://www.php.net/manual/en/function.count.php
$a = array(1,3,5);
echo count($a);
// -> 3
xxxxxxxxxx
<?php
$scores = [1, 2, 3, 4, 5];
echo count($scores);
Code language: HTML, XML (xml)
xxxxxxxxxx
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sep", "Oct" );
// To Printing the array size
echo count($months);