【问题标题】:Why does my ckEditor not save the ' character properly?为什么我的 ckEditor 不能正确保存 ' 字符?
【发布时间】:2017-11-22 08:21:32
【问题描述】:

ckEitor 不会在我的数据库中保存单个引号。除单引号外,所有其他字符和特殊字符都保存。

示例:

【问题讨论】:

  • 对我来说似乎是一个编码问题。是否所有文档都具有相同的编码,并且您的 HTML 具有正确的<meta charset="...">

标签: php html ckeditor decode


【解决方案1】:

在保存到数据库之前执行此操作

$formattedContent = htmlspecialchars($content, ENT_QUOTES);

以及显示时

html_entity_decode($data, ENT_QUOTES);

这对我来说效果很好。

Read what is <meta charset=“utf-8”>?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-31
    • 2021-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多