PHP array_product() Function

6 Jan 2025 | 1 min read

The array_product() function is inbuilt function of PHP. The array_product() function calculates the product of an array. This function was introduced in PHP 5.1.0.

Syntax

Parameters

ParameterDescriptionRequired/Optional
arraySpecifies an array.compulsory

Return Type

The array_product() function returns the product as an integer or float.

Example 1

Output:

 210 

Example 2

Output:

 Array ( [0] => 2 [1] => 6 ) 12 Array ( [0] => 7 [1] => 9 ) 63 

Example 3

Output:

 39.6936144 

Example 4

Output:

 1080