【发布时间】:2013-05-03 16:28:33
【问题描述】:
在PHP中将é之类的XML实体转换为=> é的最佳方法是什么?
$string = "\xe9"; // é
echo utf8_encode($string );
工作得很好,
但是如何处理é
用 \ 替换 然后使用 utf8 ?
【问题讨论】:
-
html_entity_decode 可以解决问题。
-
似乎只适用于 PHP5.4 sandbox.onlinephpfunctions.com/code/…