The array_product function calculates and returns the product of the values of the array.
What is the syntax of the array_product function in PHP?
array_product(array)
Parameter | Description |
---|---|
array | Specify the array to calculate the product of – Required |
Example of array_product function
<?php
$arr=array(9,2,4,6);
echo(array_product($arr));
?>
The above example returns the product of the values of the array 9*2*4*6.