How to decode something beginning with “\\u” with PHP

筅森魡賤 提交于 2019-12-02 12:13:43
Artefacto

With PHP 5.4/intl:

$s = "\u4f60\u5df2\u7ecf\u6dfb\u52a0\u4e86\u6b64\u8bdd\u9898";
echo transliterator_transliterate("Hex-Any/Java", $s);

Output:

你已经添加了此话题

For versions before, you can adapt this answer.

Note that the answers here and here don't deal with supplementary characters (those that cannot be represented with one code unit in UTF-16).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!