How to get array length in php?

It’s as follows :-

<?php
$a[0] = 1;
$a[1] = 3;
$a[2] = 5;
$result = count($a);       //we get the length of array here.
?>

Leave a Reply