【发布时间】:2016-06-22 10:04:08
【问题描述】:
我有这个域名
https://test.com/?url=https://google.com/search?q=#ie7&rls=login.microsoft:en-US:IE-Address&ie=&oe=#
这是代码:
<?php
//check if the url parameter exists
if(isset($_GET['url'])) $url=$_GET['url'];
else $url=FALSE;
?>
If I use this in the html
<?=(!$url) ? '' : $url ?>
我得到的输出会以特殊字符(如 # 或 & 等)截断,并变成这样,例如 https://google.com/search?q=# 我尝试了 urlencode/decode 但无法弄清楚
【问题讨论】:
-
您尝试获取锚散列。你不能在 php.ini 中做到这一点。 See this answer in stackoverflow
-
谢谢,其他字符,如 & 和空格等。# 只是我用来测试的一个例子,但通常问题在于 & 和空格。