我用$content=$arr[content];从数据库里取得content 然后想显示到fckeditor
<?php
include("../include/editor/fckeditor.php");
$editor = new FCKeditor('content') ;
$editor->BasePath = '../include/editor/';
$editor->ToolbarSet='Default'; //工具按钮设置
$editor->Width = '100%' ;
$editor->Height = '500' ;
$editor->Value = $content;
$editor->Create() ;
?>
但fckeditor 显示的是源代码:
<p>我是中国人</p> <p><img width="500" height="700" alt="" src="/pic/55831805011.jpg" /></p>
但我用
$editor->Value = "<p>我是中国人</p> <p><img width=500 height=700 src=/pic/55831805011.jpg /></p>";
又能正确显示.这是怎么回事?
<?php
include("../include/editor/fckeditor.php");
$editor = new FCKeditor('content') ;
$editor->BasePath = '../include/editor/';
$editor->ToolbarSet='Default'; //工具按钮设置
$editor->Width = '100%' ;
$editor->Height = '500' ;
$editor->Value = $content;
$editor->Create() ;
?>
但fckeditor 显示的是源代码:
<p>我是中国人</p> <p><img width="500" height="700" alt="" src="/pic/55831805011.jpg" /></p>
但我用
$editor->Value = "<p>我是中国人</p> <p><img width=500 height=700 src=/pic/55831805011.jpg /></p>";
又能正确显示.这是怎么回事?
把$editor->Value = $content;
在前面加上那个html_entity_decode这样就可以了:$editor->Value = html_entity_decode($content) ;