所以我试图从地址栏中获取一个如下所示的 url:
http://mysite.com/url.php?name=http://test.com/format.jsp?id=738ths3&secure=false
我正在使用 $_GET 变量从 URL 中读取它,我的代码如下
$arc = rawurlencode($_GET['name']);
echo "URL: $arc";
这只会返回
URL: http://imgur.com/format.jsp?id=738ths3
它缺少 &secure=false
我希望它看起来是什么:
URL: http://test.com/format.jsp?id=738ths3&secure=false
我尝试了 urlencode,rawurlencode 无济于事,我在 google 中查看了许多论坛和 stackoverflow 没有答案帮助,有什么想法吗?谢谢!
urlencode 显示了这一点:
网址:http%3A%2F%2Ftest.com
所以我也不能吃!