我有以下的URL:$url = 'http://mysite.com/?p=welcome&x=1&y=2';
我需要对其进行解码,以便header("Location: $url");
可以正常工作。
但是,使用urldecode($url)
不起作用,因为它没有解码&
-> &
,所以浏览器将重定向到http://mysite.com/?p=welcome&x=1&y=2
,这会导致失败。
我需要对其进行解码,使其看起来像:http://mysite.com/?p=welcome&x=1&y=2
我该怎么办?
header("Location: $url")
- 注意冒号:
。 - Marc B