Seeing the ghost, $ _ request problems

Source: Internet
Author: User
Seeing the ghost, $ _ request question. & lt ;? Php $ counter & nbsp; 0; $ temp & nbsp; 0; while (! Is_null & nbsp; ($ _ REQUEST [& #39; thisAnswer_id & #39 ;. & nbsp; ++ $ counter]) {++ $ temp; echo has a problem with $ _ request.
$ Counter = 0;
$ Temp = 0;
While (! Is_null ($ _ REQUEST ['thisanswer _ id'. ++ $ counter]);
{
+ + $ Temp;
Echo "~~ Temp is ". $ temp ."~~ ";
Echo "~~ Counter is ". $ counter ."~~ ";
$ ThisAnswer_id = array ($ counter = >$ _ REQUEST ['thisanswer _ id'. $ counter]);
?>
The output result is:
~~~ Temp is 1 ~~~
~~~ Counter is 3 ~~~
In addition, if the loop is executed only once, several values will be passed in before.
The purpose of this operation is to receive and store the same values of many attributes transmitted from the previous page in a circular manner into an array.
Please show me what is going on. thank you.

------ Solution --------------------
While (! Is_null ($ _ REQUEST ['thisanswer _ id'. ++ $ counter]);

Remove the ";" sign after this line ....

There will be another number.

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.