title: PHP - Read dynamically generated (and echoed) HTML into a string?
body: <p>I have a file that pulls some information from the database and creates some relatively simple dynamic HTML.</p>
  
  <p>The file can then be used by DOMPDF to turn it into a PDF document. DOMDPF uses GET variables to achieve the basic implementation. </p>
  
  <pre><code>ob_start();
  include_once("report.php?id=1249642977");
  
  require_once("dompdf/dompdf_config.inc.php");
  
  $dompdf = new DOMPDF();
  $dompdf-&gt;load_html(ob_get_contents());
  $dompdf-&gt;render();
  $dompdf-&gt;stream("sample.pdf", array('Attachment'=&gt;'0'));
  
  ob_end_clean();
  </code></pre>
  
  <p>I thought I might be able to use something ilke that to achieve the aim but unsurprisingly it didn't work.</p>
  
  <p>So how can I read the HTML that gets output to the browser if you were to load the file directly, into a string for use with the DOMPDF class?</p>