ckeditor echo php变量?

时间:2009-12-13 21:14:45

标签: php mysql ckeditor

使用wysiwyg CKEditor我将以下内容存储到MySql中:

 <p>
Here is the information that we would like to have show</p>
<p>
&nbsp;</p>
<p>
Project:<?php echo $project; ?></p>

我需要将此内容作为$ content回显,并从_POST数据填充$ project变量。

当我这样做时,结果如下:

Here is the information that we would like to have show

Project: 

在页面的源代码中,您可以看到echo语句,但是只要知道$ project变量已设置且具有值,就不会出现任何内容。

有人提到str_replace语句并将变量写为%project%但是它如何从%project%更改为<?php echo $project; ?>

感谢阅读。

汤姆

1 个答案:

答案 0 :(得分:1)

执行保存在字符串中的php,您可以使用eval()

我也更喜欢%project%方法。我认为这是如何运作的:

echo str_replace('%project%', $project, $sql_content);
相关问题