To transfer parameters with "/" from the template to the controller method,-php Tutorial

Source: Internet
Author: User
To transfer the parameter with "" from the template to the controller method, http: // 192.168.1.253/index. php/Home/Index/index4/kind/idea/media/entertainment. like this, I want to pass the idea/media/entertainment string as a parameter to the following method, but kind can only receive the idea behind it. I don't know if I can solve the/problem ....


Reply to discussion (solution)

Replace/with other special symbols in the parameter, such as originality-media-entertainment

What framework are you using? Or write it by yourself?

Echo $ _ SERVER ['path _ info'] in index. php to check whether the data is complete.

Your own code is $ data = explode ('/', trim ($ _ SERVER ['path _ info']);
If a framework is used, it must comply with the framework's conventions.
For example, TP is defined as the module name/method name/key/value...




Replace/with other special symbols in the parameter, such as originality-media-entertainment



Good way to like one

What framework are you using? Or write it by yourself?

Echo $ _ SERVER ['path _ info'] in index. php to check whether the data is complete.

Your own code is $ data = explode ('/', trim ($ _ SERVER ['path _ info']);
If a framework is used, it must comply with the framework's conventions.
For example, TP is defined as the module name/method name/key/value...




.. Taught 3Q!

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.