Compute and return the product of arrays:
<?php$a=array(5,5);echo(array_product($a));?>The array_product() function calculates and returns the product of arrays.
array_product( array )
parameter | describe |
---|---|
array | Required. Specifies an array. |
Return value: | Returns a product of integers or floating point numbers. |
---|---|
PHP version: | 5.1.0+ |
Update log: | As of PHP 5.3.6, the product of empty arrays is 1. Prior to PHP 5.3.6, the product of empty arrays was 0. |
Compute and return the product of arrays:
<?php$a=array(5,5,2,10);echo(array_product($a));?>