Save an include's output to a string?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="http://stackoverflow.com/questions/1195588/storing-echoed-strings-in-a-variable-in-php">Storing echoed strings in a variable in PHP</a>  </p>
</blockquote>

<p>Suppose I have</p>

<pre>&lt;?php include "print-stuff.php"; ?&gt;</pre>

<p><i>print-stuff.php</i> contains PHP/HTML template, which means that when it is included, HTML gets printed. Is there any way to capture that HTML as a string, so that I may save it to use elsewhere?</p>

<p>Moving the include statement elsewhere is not an option, because <i>print-stuff.php</i> also performs logic (creates/modifies variables) that the surrounding code depends on. I simply want to move the file's output, while leaving its logic as is.</p>
