PHP中的URL解码 [英] URL Decoding in PHP

查看:77
本文介绍了PHP中的URL解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用PHP的urldecode函数对该URL字符串进行解码:

I am trying to decode this URL string using PHP's urldecode function:

urldecode("Ant%C3%B4nio+Carlos+Jobim");

这应该输出...

'Antônio Carlos Jobim'

...但是相反,它是

...but instead is ouptutting this

'Antônio Carlos Jobim'

我已经在基于JS的在线解码器中测试了该字符串,并取得了巨大的成功,但似乎无法在服务器端执行此操作.有什么想法吗?

I've tested the string in a JS-based online decoder with great success, but can't seem to do this operation server side. Any ideas?

推荐答案

您的字符串也是 UTF-8编码的.这将起作用:

Your string is also UTF-8 encoded. This will work:

echo utf8_decode(urldecode("Ant%C3%B4nio+Carlos+Jobim"));

输出:安东尼奥·卡洛斯·乔宾".

Output: "Antônio Carlos Jobim".

这篇关于PHP中的URL解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆