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

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

Usage and examples of the PHP array_product() function

PHP Array Function Manual

The 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