详情页

使用 htmlspecialchars转义数据库里的文章

时间:2023年10月01日

编辑:佚名

小记一下
使用 htmlspecialchars_decode()函数将转义字符还原为HTML标签
$str = '<p><span style=&quot;;font-family:微软雅黑;font-size:16px&quot;> <span style=&quot;font-family:微软雅黑&quot;>';
htmlspecialchars_decode($str)
返回
'<p><span style=";font-family:微软雅黑;font-size:16px"> <span style="font-family:微软雅黑">'
相关文章
猜你需要