This question already has an answer here:
- PHP eval issue with PHP + HTML code 5 answers
I have my page contents saved in a database and would like to execute any php code in the string. So if my string was:
<h1>Welcome</h1><?php echo $motto?><br/>
I only want to execute echo $motto
. Using eval() will try to execute <h1>Welcome</h1>
.
Any way to do this?
</div>