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
- array_change_key_case
- array_chunk
- array_combine
- array_count_values
- array_diff_assoc
- array_diff_key
- array_diff_uassoc
- array_diff_ukey
- array_diff
- array_fill_keys
- array_fill
- array_filter
- array_flip
- array_intersect_assoc
- array_intersect_key
- array_intersect_uassoc
- array_intersect_ukey
- array_intersect
- array_key_ exists
- array_keys