PHP.nl

array_product

array_product

Calculate the product of values in an array

 **array_product** array $array
returns the product of values

in an array. array_product

arrayThe array.

Returns the product as an integer or float.

Voorbeeld: examples

<?php

$a = array(2, 4, 6, 8);
echo "product(a) = " . array_product($a) . "\n";
echo "product(array()) = " . array_product(array()) . "\n";

?>
product(a) = 384
product(array()) = 1