How do I get PHP "includes" in an echoed string "executed"?
Posted: Mon Feb 06, 2012 1:43 am
I have a .PHP file with PHP includes embedded in it to include some HTML into the page, such as the menu and the page diversions layout. I use SSI when the file is not as .PHP file.
If make up a little test and my php code does the following:
the PHP includes in the included file are "executed/evaluated/performed" - whatever you wish to call it.
If I do it as follows, the includes are not "executed.'
Any thoughts?
Bob
If make up a little test and my php code does the following:
Code: Select all
ob_clean(); // to get rid of any earlier output.
include("file.php");If I do it as follows, the includes are not "executed.'
Code: Select all
ob_clean();
$fileContents = get_file_contents("file.php");
echo $fileContents;Bob