English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP array_product() function usage and example

PHP Array Function Manual

PHP array_product() function calculates the product of all values in the array

Syntax

array_product($array);

Definition and Usage

It returns the product of the values in the array as an integer or floating-point number.

Parameter

Serial NumberParameters and Description
1

array(Required)

It specifies an array.

Return Value

It returns the product of the values in the array.

Online Example

Calculate the product of all values in the array

<?php
   $input = array(5,6,3);
   
   print_r(array_product($input));
?>
Test and see‹/›

Output Result:

90

PHP Array Function Manual