【问题标题】:HTML tags saved to database as HTML entitiesHTML 标记作为 HTML 实体保存到数据库
【发布时间】:2015-09-15 03:06:56
【问题描述】:

标签: php html mysql utf-8 tinymce


【解决方案1】:

您可能正在寻找 html_entity_decode 函数,

http://php.net/manual/en/function.html-entity-decode.php

$page_content = html_entity_decode($page_text);

小心注射等。

【讨论】:

  • 是的,它是 tinymce 编辑器,谢谢@wilo087!即使 var_dump 显示 string(23) "

    test

    ",HTML 已被转换为实体,我也应该选择与额外实体字符相关的 string(23)。 html_entity_decode 帮我修好了,非常感谢!
【解决方案2】:

我认为问题出在编辑器上。

你能在插入数据库之前打印 $page_content 的值给我们看吗?

同样,请参阅这篇文章。 HTML Tags stripped using tinyMCE

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    • 2018-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多