PHP program to count number of elements in an array:
The below program is to count number of elements of an array using count() function. The PHP echo statement is used to output the result on the screen. An array is a single variable which can store multiple values at a time.
<!DOCTYPE html> <html> <body> <?php $food = array("PIZZA", "BURGER", "COKE"); echo count($food); ?> </body> </html>