PHP array_product() Function
Last Updated : 17 Mar 2025
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
| Parameter | Description | Required/Optional |
|---|---|---|
| array | Specifies 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
Next TopicPhp-array-push-function