CodesJava

Easy learning with example program codes

PHP program to count number of elements in an array

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.
Example

<!DOCTYPE html>
<html>
<body>
 
<?php
$food = array("PIZZA", "BURGER", "COKE");
echo count($food);
?>
 
</body>
</html>

Output

3
Please follow and like us:
error
Posted in PHP   








Copyright © 2019 CodesJava DMCA.com Protection Status