Hi guys,
What I need to be able to do is as follows:
- Include the contents of a local file as a PHP variable
- Execute any PHP code found in said file
- Output the contents simply by calling echo $variable; at a later stage in the script
First off I tried simply using $content = include('myfile.inc.php'); with the hope of calling $content later but that included the contents of the file immediately rather than setting the contents as the value of the variable.
The reason I need to do this is because I need to pass $content as a parameter to a template class to be output on the generated page.
This has got to be possible... but I really have no clue as to how!
Thanks for any and all help 🙂
Sam