I'm storing individual pages containing HTML and PHP in a database as plain text, like this:
<body>
<h1>Welcome</h1>
<?PHP $welcome = "Hello";
echo $welcome;
?>
<br />
</body>
And the desired result is to execute the PHP code mixed in with the plain text, so the above code would look like the following HTML to the browser:
<body>
<h1>Welcome</h1>
Hello<br />
</body>
I am using a function that simply ECHO's the plain text from the database to the page, so obviously, the PHP never gets treated as PHP.
How would you go about converting the PHP from being interpreted as plain text, to be executed as actual PHP code?