php - 这个字符串使用的编码方式是什么?

标签 php url encoding

我正在阅读文档,但未指定如何对 url 进行编码。通常,您使用 urlencode,但我认为这里不是这种情况。此字符串中使用的编码方法是什么:

http://url.retour.com/err.cgi?order_ref=votreRF12345

编辑: 我应该按顺序对此字符串 http://url.retour.com/err.cgi?order_ref=votreRF12345 调用什么 php 方法对其进行编码?

最佳答案

这个字符串可以用html_entity_decode解码,像这样:

<?php
echo html_entity_decode('http&#x3a;&#x2f;&#x2f;url.retour.com/err.cgi&#x3f;order_ref&#x3d;votreRF12345');"
// output: http://url.retour.com/err.cgi?order_ref=votreRF12345

关于php - 这个字符串使用的编码方式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7254895/

相关文章:

encoding - 如何将 cp1251 字节数组转换为 utf8 字符串?

php - 无法以注册用户身份登录(php 和 mysql)

php - 限制 Laravel 中的重复查询

google-chrome - 在 Google Chrome 中复制西里尔文 URL?

javascript - 如何将 javascript textBox 值作为参数传递给 URL

windows - Windows 上的文件是否具有编码属性?

algorithm - 以微秒精度压缩 unix 时间戳

php - 真正的随机数

php - 如何根据mysql总和找出一行的排名?

java - 如何实现在 JTextPane 中将 URL 作为超链接插入的 DocumentFilter?