如何从$ _REQUEST - 正则表达式获得加号的符号?(How to get the symbol of plus as it is from $_REQUEST - regular expressions?)
如何在传递$ _REQUEST时传递plus +符号?
例如,我想通过这个,
xxx.php?key=xPo8lUEXpqg8bKL+32o6yIOK我想在echo $ _REQUEST ['key']中获得xPo8lUEXpqg8bKL+32o6yIOK ; 但我会在下面得到这个 -
xPo8lUEXpqg8bKL 32o6yIOK我应该怎么做才能解决这个问题? 正则表达式再次?
谢谢。
How to pass the symbol of plus + as it is when you want to pass it into $_REQUEST?
For instance, I want to pass this,
xxx.php?key=xPo8lUEXpqg8bKL+32o6yIOKand I want to get xPo8lUEXpqg8bKL+32o6yIOK in echo $_REQUEST['key']; but I will get this below instead -
xPo8lUEXpqg8bKL 32o6yIOKWhat should I do to fix this? Regular expressions again??
Thanks.
最满意答案
您需要使用%2B而不是+ ,因为+是空间的URL编码符号。 一般来说,你应该使用urlencode()来正确地转义事物:
$url = "xxx.php?key=" . urlencode('xPo8lUEXpqg8bKL+32o6yIOK');You need to use %2B instead of +, as + is the URL-encoded symbol for a space. In general, you should use urlencode() to escape things properly:
$url = "xxx.php?key=" . urlencode('xPo8lUEXpqg8bKL+32o6yIOK');更多推荐
发布评论