array_product in php example

It calculates the product of all the array values.

Syntax:

array_product($array);

Program:

<?php
$number=array(10,20,5);
print_r($number);
$total=array_product($number); 
//array_product() calculates the product values for $number array values.
echo "product of given array  is\t";
print_r($total);
?>

 

Output:

array_product output

 

 

 

Thanks for reading this post…………..!!!

235 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *