我想存储以下内容:
$str= "• This is a bullet point";
在我的数据库中作为实际的要点而不是它的 html_entity 值。
我试过:
$new_str = html_entity_decode($str);
在我将它存储在数据库中之前,然而这似乎只适用于某些 html_entities,例如,它适用于 # 或 & 但不适用于 •
知道我该怎么做吗?...问候 J
最佳答案
$new_str = mb_convert_encoding($str, 'UTF-8', 'HTML-ENTITIES');
关于php - 如何在 mysql 中存储 html_entites 作为它们的表示而不是它们的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10862238/