PHP array_product() function

P
PHP array_pop() function
PHP array_push() function

The array_product function calculates and returns the product of the values of the array.

What is the syntax of the array_product function in PHP?

array_product(array)
ParameterDescription
arraySpecify the array to calculate the product of – Required
array_product function in PHP

Example of array_product function

<?php
$arr=array(9,2,4,6);
echo(array_product($arr));
?>

The above example returns the product of the values of the array 9*2*4*6.

PHP array_pop() function
PHP array_push() function

Add comment

Tutor Network

Share this

Learn PHP from A to Z