Take the 2-minute tour ×

Using the wysiwyg CKEditor I stored the following into MySql:

Here is the information that we would like to have show</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


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.


share|improve this question
Can you please add also the code where the value of $project is set? Thanks –  Vafliik Dec 13 '09 at 21:22

1 Answer 1

up vote 1 down vote accepted

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:

echo str_replace('%project%', $project, $sql_content);
share|improve this answer

Your Answer


