使用 html_entity_decode() 的问题

Issue using html_entity_decode()

好吧,我正在构建这个爬虫,我在其中爬取非英文的文章内容。然而,一旦我将内容存储到数据库中,html_entity_decode 就无法正确完成工作,因此我得到了奇怪的字符,而不是想要的字符。

这是我用于该部分的代码行:

    $content=html_entity_decode($content, ENT_COMPAT, 'UTF-8');

但是,如上所述,而不是得到这个字符

ë

我要这个

ë

你能就这个问题提出建议吗?

我基本上完成了下面 link 中的步骤,效果非常好。

There are symbols like  and so on in database, what to do?

您可以使用此代码

$content = html_entity_decode($content, ENT_QUOTES);