We can get the number of elements in an array with the count function:
<?php $names = ['A', 'B', 'C']; $size = count($names); //from w w w . j av a 2s .co m var_dump($size); // 3 ?>