PHP Post Array Method _php tutorial

Source: Internet
Author: User
How do i abbreviate a sentence like this? Ask for help Oh 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;
Copy code How do i abbreviate a sentence like this?
Don't want to hit so many hands


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 marker [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 to be troublesome ... I don't know..

If $_post only contains so few, you can
echo Array_sum ($_post);



Other Solutions


for ($i =1; $i <11; $i + +) {
$temp [] = $_post[' V '. $i];
}
echo Array_sum ($temp);

???? It seems to be troublesome ... I don't know..

If $_post only contains so few, you can
echo Array_sum ($_post);

Other Solutions


Array_sum ($_post[]);
Sum this global array

Other Solutions
Array_sum ($_post[]);
Sum this global array
Iminto posted in 2009-5-11 19:00 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=993037&ptid=118194] link tags [Img]http://bbs.111cn.cn/images/common/back.gif[/img][/url]
Array_sum ($_post[]);
How to use it?

Other Solutions
[url=http://cn.php.net/manual/en/function.array-sum.php] link marker http://cn.php.net/manual/en/function.array-sum.php [/URL]

Other Solutions
Array_sum ($_post[]);
How to use it?
Zyyr365 published in 2009-5-11 19:03 [url=http://bbs.111cn.cn/redirect.php?goto=findpost&pid=993040&ptid=118194] Link marker [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 it, it's a function ...

Other Solutions
Array_sum--Calculates the and of all values in the array
Description
Number Array_sum (array array)
Array_sum () returns the value of all the values in the array and the result of an integer or floating-point number.

So it's getting into the array, and ...
See I try ~

Other Solutions
I think of another way.
for ($i =1; $i <=10; $i + +) {
$num + = $_post[' V '. $i];
}
Echo $num;


http://www.bkjia.com/PHPjc/632514.html www.bkjia.com true http://www.bkjia.com/PHPjc/632514.html techarticle How do i abbreviate a sentence like this? Help Oh online etc $num = $_post[' v1 ']+$_post[' v2 ']+$_post[' v3 ']+$_post[' v4 ']+$_post[' v5 ']+$_post[' V6 ']+$_post[' v7 ']+$_post[' V8 ']+$_post[' v9 ']+$_p ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.