开发者

What is the encoding method used in this string?

I am reading a documentation, but it is not specified how to encode url's. Normally, you use urlencode, but i don't think it is the case here. What is the encoding method used in this string :

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

Edit: Wha开发者_如何学Got php method(s) sould i invoke on this string http://url.retour.com/err.cgi?order_ref=votreRF12345 in order to encode it ?


This string can be decoded with html_entity_decode, like this:

<?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


It's HTML/XML encoding. The structure is &#, then x and the hex value of the Unicode codepoint (in this case identical to ASCII) and a closing ;.


XML Entities - x3f means char 03F UTF which is ?


These are HTML entities. Decode them with html_entity_decode (ref)

In response to your edit: encode with htmlentities (ref)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜