Jump to: navigation, search

Php array product

From w3cyberlearnings

Contents

PHP function array_product

This function calculates the product of all elements of the array. Array elements have to be numeric.

Syntax array_product

  • array: array input
array_product(array);

Example 1

<?php 
  $product = array(8,8);
  $result = array_product($product);
  echo $result;
?>

Output

64

Example 2

<?php

$list = array(2,3,4);

$r = array_product($list);
echo $r;
?>

Output

24

Related Links


Navigation
Web
SQL
MISC
References