I'd like to "include" a block of content into a php file that resides in a database.
The block could include php, html, etc.
Assuming I know how to retrieve the block from the database and I do not want to place the content into a file before I include it, how can I "include" (interpret this in the context of the current document) this into the current document?
eval() doesn't appear to work, as it expects PHP code, not PHP code embedded in an HTML file. So, If I say
$str = "echo \"<STRONG>This is <?php echo 'a'; ?> test.</STRONG>\";";
eval( $str);
I get "This is test." rather than "This is a test."
Is there a way, other than rewriting a portion of the PHP parser in PHP, to do this?
Thanks.