How to Get Array Length in PHP

To get array length in PHP, we make use of Count function.  Sample code is given below.

<?php

$array = array("Robert", "Rony", "Peter", "Sam");

echo count($array);

?>

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •