这个字符串中使用的编码方法是什么?


What is the encoding method used in this string?

我正在阅读文档,但没有指定如何编码url的。通常情况下,你使用urlencode,但我不认为这是情况。这个字符串中使用的编码方法是什么:

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

编辑:我应该在这个字符串http://url.retour.com/err.cgi?order_ref=votreRF12345上调用什么php方法(s)来编码它?

这个字符串可以用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

是HTML/XML编码。结构是&#,然后是x和Unicode码点的十六进制值(在这种情况下与ASCII相同),最后是;

XML实体- x3f表示char 03F UTF,即?

这些是HTML实体。用html_entity_decode (ref)

解码

回复您的编辑:用htmlentities (ref)编码