将符号转换为可读的


Convert symbols to readable

echo $title给了我类似于'u00ca'u00e0'u00f7'u00e5'u00eb'u00e8的东西

应该是一个可读的文本。如何正确解码?

我试过html_entity_decode($title, 0, 'UTF-8'),但它不适用于非英语语言。我得到类似Êà÷åëè的东西,而不是真正的文本。

试试echo htmlentities($str, ENT_QUOTES | ENT_IGNORE, "UTF-8");

try this

$title = mb_convert_encoding($title,'HTML-ENTITIES','utf-8');

希望这对你有用。编辑:

$title = iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8", $title);