Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
7,940 |
Shell Programming and Scripting |
|
|
|
11 |
3,979 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,686 |
Shell Programming and Scripting |
|
|
|
4 |
8,824 |
Shell Programming and Scripting |
|
|
|
6 |
2,034 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,454 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
20,768 |
Shell Programming and Scripting |
|
|
|
3 |
16,981 |
Shell Programming and Scripting |
|
|
|
8 |
2,182 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
3,129 |
Shell Programming and Scripting |
|
|
|
4 |
1,974 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
1,911 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
5,894 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
3,968 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,258 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,105 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
2,895 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
922 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
7,205 |
Shell Programming and Scripting |
|
|
|
6 |
4,486 |
Shell Programming and Scripting |
|
|
|
3 |
15,471 |
AIX |
|
|
|
3 |
2,303 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
1,622 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
5,297 |
Shell Programming and Scripting |
|
|
|
3 |
1,843 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
16,159 |
AIX |
|
|
|
6 |
13,281 |
Homework & Coursework Questions |
|
|
|
3 |
4,653 |
Shell Programming and Scripting |
|
|
|
3 |
823 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
2,678 |
Shell Programming and Scripting |
|
|
|
29 |
2,985 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,606 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,928 |
Shell Programming and Scripting |
|
|
|
12 |
2,009 |
Shell Programming and Scripting |
|
|
|
2 |
897 |
Shell Programming and Scripting |
|
|
|
17 |
1,919 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,803 |
What is on Your Mind? |
|
|
|
6 |
1,645 |
Shell Programming and Scripting |
|
|
|
8 |
5,774 |
Shell Programming and Scripting |
|
|
|
9 |
1,348 |
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)