Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
40,464 |
Shell Programming and Scripting |
|
|
|
11 |
5,251 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
41,793 |
Shell Programming and Scripting |
|
|
|
4 |
39,755 |
Shell Programming and Scripting |
|
|
|
6 |
2,621 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,932 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
33,392 |
Shell Programming and Scripting |
|
|
|
3 |
21,714 |
Shell Programming and Scripting |
|
|
|
8 |
3,596 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
6,338 |
Shell Programming and Scripting |
|
|
|
4 |
2,805 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
2,277 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
8,674 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
5,879 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,715 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,511 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
6,425 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,201 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
11,301 |
Shell Programming and Scripting |
|
|
|
6 |
6,330 |
Shell Programming and Scripting |
|
|
|
3 |
17,931 |
AIX |
|
|
|
3 |
2,689 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
2,590 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
9,076 |
Shell Programming and Scripting |
|
|
|
3 |
2,198 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
19,422 |
AIX |
|
|
|
6 |
17,843 |
Homework & Coursework Questions |
|
|
|
3 |
5,182 |
Shell Programming and Scripting |
|
|
|
3 |
1,119 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
4,684 |
Shell Programming and Scripting |
|
|
|
29 |
4,926 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,100 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,906 |
Shell Programming and Scripting |
|
|
|
12 |
5,456 |
Shell Programming and Scripting |
|
|
|
2 |
1,336 |
Shell Programming and Scripting |
|
|
|
17 |
2,754 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
4,470 |
What is on Your Mind? |
|
|
|
6 |
2,549 |
Shell Programming and Scripting |
|
|
|
8 |
9,532 |
Shell Programming and Scripting |
|
|
|
9 |
2,185 |
Shell Programming and Scripting |
ARRAY_PRODUCT(3) 1 ARRAY_PRODUCT(3)
array_product - Calculate the product of values in an array
SYNOPSIS
number array_product (array $array)
DESCRIPTION
array_product(3) returns the product of values in an array.
PARAMETERS
o $array
- The array.
RETURN VALUES
Returns the product as an integer or float.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.6 | |
| | |
| | The product of an empty array is now 1, when |
| | before this function would return 0 for an empty |
| | array. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
array_product(3) examples
<?php
$a = array(2, 4, 6, 8);
echo "product(a) = " . array_product($a) . "
";
echo "product(array()) = " . array_product(array()) . "
";
?>
The above example will output:
product(a) = 384
product(array()) = 1
PHP Documentation Group ARRAY_PRODUCT(3)