我有以下文字:
We%27re%20proud%20to%20introduce%20the%20Amazing
Run Code Online (Sandbox Code Playgroud)
我想使用PHP删除编码,但使用html_entity_decode()不起作用.
有什么建议?
ere*_*non 30
echo urldecode('We%27re%20proud%20to%20introduce%20the%20Amazing');
Run Code Online (Sandbox Code Playgroud)
这是一个url_ecoded字符串.使用urldecode
此编码称为百分比编码或URL编码.在PHP你有rawurlencode,rawurldecode在"原始"的URL编码,以及在urlencode和urldecode对于在查询中使用的略微不同的编码(而称为应用程序/ x-WWW窗体-urlencoded所在空间进行编码+,而不是%20).
在您的情况下,使用"原始"URL编码.所以尝试rawurldecode解码它:
rawurldecode('We%27re%20proud%20to%20introduce%20the%20Amazing')
Run Code Online (Sandbox Code Playgroud)