ckeditor echo php 变量?
使用所见即所得的 CKEditor,我将以下内容存储到 MySql 中:
<p>
Here is the information that we would like to have show</p>
<p>
</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% 更改为
感谢您的阅读。
汤姆
Using the wysiwyg CKEditor I stored the following into MySql:
<p>
Here is the information that we would like to have show</p>
<p>
</p>
<p>
Project:<?php echo $project; ?></p>
I need to echo this content as $content and have the $project variable populate from _POST data.
When I do this however the result looks like this:
Here is the information that we would like to have show
Project:
In the source for the page you can see the echo statement but nothing appears inspite of knowing that the $project variable is set and has a value.
Someone mentioned a str_replace statement and write the variable as %project% but how does it change from %project% to <?php echo $project; ?>
Thanks for reading.
Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要执行保存在字符串中的 php,您可以使用 eval()
我也更喜欢 %project% 方法。我认为这就是它的工作原理:
to execute php that is saved inside a string you can use
eval()
i also like the %project% approach more. i think this is how it would work: