Query: array_product
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ARRAY_PRODUCT(3) 1 ARRAY_PRODUCT(3) array_product - Calculate the product of values in an arraySYNOPSISnumber array_product (array $array)DESCRIPTIONarray_product(3) returns the product of values in an array.PARAMETERSo $array - The array.RETURN VALUESReturns the product as an integer or float.CHANGELOG+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.6 | | | | | | | The product of an empty array is now 1, when | | | before this function would return 0 for an empty | | | array. | | | | +--------+---------------------------------------------------+EXAMPLESExample #1 array_product(3) examples <?php $a = array(2, 4, 6, 8); echo "product(a) = " . array_product($a) . " "; echo "product(array()) = " . array_product(array()) . " "; ?> The above example will output: product(a) = 384 product(array()) = 1 PHP Documentation Group ARRAY_PRODUCT(3)
Related Man Pages |
---|
key(3) - php |
array_pop(3) - php |
array_keys(3) - php |
reset(3) - php |
array_product(3) - php |