Possible duplicate:
Storing echo strings in a variable in PHP
Let's pretend that
<? php include "print-stuff.php"; ?>
print-stuff.php contains a PHP / HTML template, which means that when it is turned on, HTML is printed. Is there a way to capture this HTML as a string so that I can save it for use elsewhere?
Moving the include statement elsewhere is not an option because print-stuff.php also executes the logic (creates / modifies variables) that the surrounding code depends on. I just want to move the output of the file, leaving its logic as it is.
Steve source share