Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
63,317 |
Shell Programming and Scripting |
|
|
|
11 |
9,309 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
67,981 |
Shell Programming and Scripting |
|
|
|
4 |
62,585 |
Shell Programming and Scripting |
|
|
|
6 |
5,249 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,115 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
42,559 |
Shell Programming and Scripting |
|
|
|
3 |
28,026 |
Shell Programming and Scripting |
|
|
|
8 |
7,438 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
10,415 |
Shell Programming and Scripting |
|
|
|
4 |
4,638 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
3,816 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
14,343 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
14,417 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
5,953 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,261 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
8,937 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,697 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
16,257 |
Shell Programming and Scripting |
|
|
|
6 |
8,995 |
Shell Programming and Scripting |
|
|
|
3 |
21,380 |
AIX |
|
|
|
3 |
4,037 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
6,190 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
13,958 |
Shell Programming and Scripting |
|
|
|
3 |
3,324 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
22,964 |
AIX |
|
|
|
6 |
21,909 |
Homework & Coursework Questions |
|
|
|
3 |
6,523 |
Shell Programming and Scripting |
|
|
|
3 |
2,297 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
7,279 |
Shell Programming and Scripting |
|
|
|
29 |
10,619 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,816 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
6,000 |
Shell Programming and Scripting |
|
|
|
12 |
8,919 |
Shell Programming and Scripting |
|
|
|
2 |
2,206 |
Shell Programming and Scripting |
|
|
|
17 |
5,703 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
7,084 |
What is on Your Mind? |
|
|
|
6 |
3,886 |
Shell Programming and Scripting |
|
|
|
8 |
12,651 |
Shell Programming and Scripting |
|
|
|
9 |
3,315 |
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)