我们通过WEB编辑器写好代码后,要写入到数据库,需要对特殊代码进行转义处理,我们使用PHP原生的htmlspecialchars()函数进行处理。$content=htmlspecialchars($content); 在页面输出内容时,需要反转义再输出,这时候我使用html_entity_decode()函数进行处理$content=html_entity_decode($content); Last modification:February 16, 2020 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 如果觉得我的文章对你有用,请随意赞赏