CodesJava

Easy learning with example program codes

PHP program to find the product of elements in an array

PHP program to find the product of elements in an array:

The below program is to find the product of elements in an array. 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    
$numbers=array("10","20","30","40");    
echo "Product of array elements is: ";
echo array_product($numbers);
?>    
 
</body>
</html>

Output

Product of array elements is: 240000
Please follow and like us:
error
Posted in PHP   








Copyright © 2019 CodesJava DMCA.com Protection Status