How can I describe such a sentence? Help, online, etc.
$ Num = $ _ POST ['v1 '] + $ _ POST ['v2'] + $ _ POST ['v3'] + $ _ POST ['v4 '] + $ _ POST ['v5 '] + $ _ POST ['v6'] + $ _ POST ['v7'] + $ _ POST ['v8 '] + $ _ POST [' v9'] + $ _ POST ['v10'];
Echo $ num;
How can I abbreviated this sentence to copy the code?
Don't want to fight so much
Best Answer [url = http://www.111cn.cn/bbs/space.php? Username = microwind] link tag microwind [/url]
[Url = http://www.111cn.cn/bbs/space.php? Uid = 39178] link tag [img] http://www.111cn.cn/server/avatar.php? Uid = 39178 & size = small [/img] [/url]
For ($ I = 1; $ I <11; $ I ++ ){
$ Temp [] = $ _ POST ['V'. $ I];
}
Echo array_sum ($ temp );
???? It seems very troublesome... I don't know ..
If $ _ POST contains only a few of them, you can
Echo array_sum ($ _ POST );
Other solutions
For ($ I = 1; $ I <11; $ I ++ ){
$ Temp [] = $ _ POST ['V'. $ I];
}
Echo array_sum ($ temp );
???? It seems very troublesome... I don't know ..
If $ _ POST contains only a few of them, you can
Echo array_sum ($ _ POST );
Other solutions
Array_sum ($ _ POST []);
Sum the Global Array
Other solutions
Array_sum ($ _ POST []);
Sum the Global Array
Iminto posted at [url = http://bbs.111cn.cn/redirect.php? Goto = findpost & pid = 993037 & ptid = 118194] link mark [img] http://bbs.111cn.cn/images/common/back.gif?/img=#/url]
Array_sum ($ _ POST []);
How to use it?
Other solutions
[Url = Response
Other solutions
Array_sum ($ _ POST []);
How to use it?
Zyyr365 published on [url = http://bbs.111cn.cn/redirect.php? Goto = findpost & pid = 993040 & ptid = 118194] link mark [img] http://bbs.111cn.cn/images/common/back.gif?/img=#/url]
[Img] http://www.111cn.cn/bbs/images/smilies/default/02.gif#/img]
That's how it works. This is a function ......
Other solutions
Array_sum -- calculate the sum of all values in the array
Description
Number array_sum (array)
Array_sum () returns the sum of all values in the array as an integer or floating point number.
In this case, we get the data in the array, and then...
Understand how to try ~
Other solutions
I came up with another method.
For ($ I = 1; $ I <= 10; $ I ++ ){
$ Num + = $ _ POST ['V'. $ I];
}
Echo $ num;