PHP parses the URL and loses parameters in the URL

Source: Internet
Author: User
PHP parses the URL and obtains the URL parameter & lt ;? Php illustrates a URL-formatted string: $ strtest. comtestdirindex. php? Param110 & amp; param220 & amp; param330 & amp; param440 & amp; param550 & amp; param660; 1. use parse_ur PHP to parse the URL and obtain the parameters in the URL.

 $ Param) {$ tmp [] = $ k. '='. $ param;} $ params = implode ('&', $ tmp); return $ params;}?>

Output result:

array (size=4)  'scheme' => string 'http' (length=4)  'host' => string 'test.com' (length=8)  'path' => string '/testdir/index.php' (length=18)  'query' => string 'param1=10&param2=20&param3=30&param4=40&param5=50&param6=60' (length=59)array (size=6)  'param1' => string '10' (length=2)  'param2' => string '20' (length=2)  'param3' => string '30' (length=2)  'param4' => string '40' (length=2)  'param5' => string '50' (length=2)  'param6' => string '60' (length=2)string 'param1=10&param2=20&param3=30&param4=40&param5=50&param6=60' (length=59)


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.