This article mainly introduces to you the solution for PHP to obtain parameters with # and other special symbols in the URL. This article uses the escape function in JS to encode and pass to solve this problem. Friends who need it can refer to it. I hope it can help everyone. .
Busy first is an example of function usage:
For example, the following PHP code:
When the url is http://test.com/ When c.php?key=999, the normal output is: 999
When the url is http://test.com/c.php?key=9#888, it can only output: 9
and I want I got 9#888, what should I do? We can only find a way to pass 9#888 to the key.
I solved this problem by encoding and passing the escape function in JS. Friends in need can refer to it.
查询
Related recommendations:
Detailed explanation of how to obtain the url instance in php
PHP regular matching code to obtain the domain name in the URL
php Get the file extension in the url
The above is the detailed content of How to get php parameters with special symbols such as # in the URL. For more information, please follow other related articles on the PHP Chinese website!