PHP Code Analysis

Source: Internet
Author: User
echo Join ('-', $_get), '
'; ① $dict = Array (' area ' = = Array ( ' inland ', ' RTHK '), ' type ' = = Array (' Action ', ' Love '), ' year ' = = Array (' 2001 ', ), foreach ($dict as $key = = $item) { $param = $_get; ② foreach ($item as $v) { $param [$key] = $v; ③ $t = Http_build_query ($param);//④ echo "$v"; } Echo '
';}



What is the meaning of ① sentence?
Do you have a special intention to assign a get to the ② clause? Is it good to use it directly?
What does ③ mean?
What does the ④ sentence mean, because it feels like the third sentence doesn't make any sense ... Thank you


Reply to discussion (solution)

Has your program been saved as search.php?

Saved, and now don't understand how your code is implemented,

The entire code is for the output $dict describe the 3 parameters of a different combination of links, a total of 6, each link on the basis of the current request parameters, only modify one of the parameters

1. Output the current request parameter $_get on the page
2. To modify the $param later, the direct use of $_get causes the second start of the $dict cycle, and some parameters are modified
3. Modify one of the parameter values, for example, to change the area to inland, or type to love
4. URL address after generating the modified parameter

  • 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.