gpt4 book ai didi

php - 如何在 mysql 中存储 html_entites 作为它们的表示而不是它们的值

转载 作者:行者123 更新时间:2023-11-29 00:45:01 24 4
gpt4 key购买 nike

我想存储以下内容:

$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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com