Easy Tutorial
❮ Func Math Pow Func Mysqli Num Rows ❯

PHP array_product() Function

Complete PHP Array Reference Manual

Example

Calculates and returns the product of an array:


Definition and Usage

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


Syntax

Parameter Description
array Required. Specifies the array.

Technical Details

Return Value: Returns the product as an integer or float.
PHP Version: 5.1.0+
--- ---
Changelog: As of PHP 5.3.6, the product of an empty array is 1. Prior to PHP 5.3.6, the product of an empty array was 0.
--- ---

More Examples

Example 1

Calculates and returns the product of an array:


❮ Func Math Pow Func Mysqli Num Rows ❯