Current Location: Home> Function Categories> array_product

array_product

Calculate the product of all values ​​in the array
Name:array_product
Category:Array
Programming Language:php
One-line Description:Calculates the product of all values ​​in the array.

Definition and usage

array_product() function calculates and returns the product of the array.

Example

Example 1

Calculate and return the product of the array:

 <?php
$a = array ( 5 , 5 ) ;
echo ( array_product ( $a ) ) ;
?>

Try it yourself

Example 2

Calculate and return the product of the array:

 <?php
$a = array ( 5 , 5 , 2 , 10 ) ;
echo ( array_product ( $a ) ) ;
?>

Try it yourself

grammar

 array_product ( array )
parameter describe
array Required. Specify array.
Similar Functions
Popular Articles