Php 如何从另一个URL获取URL作为参数

Php 如何从另一个URL获取URL作为参数,php,url,arguments,Php,Url,Arguments,我有这个网址: http://localhost/login?destination=http://localhost/myweb/search?q=anything 现在我想从上面的URL获取此URL: http://localhost/myweb/search?q=anything 但是,$\u获得['destination']不工作…,为什么?我怎样才能修好它 需要注意的是,以下是我的路由规则: RewriteEngine on RewriteCond %{REQUEST_FILEN

我有这个网址:

http://localhost/login?destination=http://localhost/myweb/search?q=anything
现在我想从上面的URL获取此URL:

http://localhost/myweb/search?q=anything
但是,
$\u获得['destination']不工作…,为什么?我怎样才能修好它

需要注意的是,以下是我的路由规则:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]  // I get the path usin$_GET['rt']

ErrorDocument 404 /error404.html

您需要
urlencode('http://localhost/myweb/search?q=anything)
那部分。@abracadver,有可能再次解码吗?当您访问
$\u GET['destination']
时,它将被解码。但作为参考,您需要
urlencode('http://localhost/myweb/search?q=anything)
那部分。@abracadver,有可能再次解码吗?当您访问
$\u GET['destination']
时,它将被解码。但仅供参考