We can use the count() or sizeof() function to get the number of elements in an array.

BY Best Interview Question ON 07 Apr 2020

Example

$array1 = array("1","4","3");
echo count($array1);

OUTPUT : 3