As opposed to using an include, which executes the included php in the file...is it possible to save the contents of a php file to a variable - but with the php still intact and executable?
My goal looks something like:
$template = some_imaginary_include_function('myfile.php');
foreach($list_of_blogs as $blog) {
// somehow get blog content in template and render template;
}
I know thats a dumb example...but I hope it illustrates the general idea. If I have to loop through the template 50 times on a page (say it is a list of blogs), it seems dumb to actually run and include for each.
Am I wrong? Is there a way to do this?