url中的未知字符%252B

nut*_*les 4 php encoding ascii urlencode

我有一个页面链接来自rss.他们是:断链

http://news.asiaone.com/News/Latest%252BNews/Singapore/Story/A1Story20121220-390687.html
Run Code Online (Sandbox Code Playgroud)

工作环节

http://news.asiaone.com/News/Latest%2BNews/Singapore/Story/A1Story20121220-390687.html
Run Code Online (Sandbox Code Playgroud)

我意识到它的工作原理是将%252B更改为%2B.即时通讯使用PHP.有没有办法在跑步中检测并纠正它?

dec*_*eze 14

该URL已经过双重编码.%25是"%"的转义序列,所以常规%2B再次转义为%252B.

urldecode 值,但最好避免双重编码,如果可能的话开始.


sk8*_* ツ 0

使用“url解码”

echo urldecode("http://news.asiaone.com/News/Latest%252BNews/Singapore/Story/A1Story20121220-390687.html");
Run Code Online (Sandbox Code Playgroud)