1// using count() we can get proper length of the array
2$names = array("Ankur","Raj","Ram","Suresh");
3// pass array into count() as parameter it will return array length
4echo count($names);
5
6// output : 4
1<?php
2 //use count($var) ->
3$a[0] = 1;
4$a[1] = 3;
5$a[2] = 5;
6var_dump(count($a));