我设置了一个数据库系统,用于存储和输出CMS中的页面和帖子,但是我从数据库中得到了如下返回:
<p>&lt;iframe width="854" height="480" src="https://www.youtube.com/embed/PMf6PjVXRtc" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;</p>
此时,我已经删除了所有编码--它只是一个直接的CakePHP ->Save,这似乎是CakePHP的数据清理的结果。
$this->save(
array(
'contentBody' => $data["contentBody"]
),
false
);
在输出端,我可以做什么来正确地显示这个编码的HTML呢?输出可以包括常规回显或打印,以及TinyMCE文本区域。
发布于 2015-11-28 14:45:19
在进行输出之前,必须使用html_entity_decode()
。假设您在变量$str
中有输出html,请使用以下方式输出:
echo html_entity_decode(html_entity_decode($str));
https://stackoverflow.com/questions/33972405
复制相似问题