title: Extract Table as Text Using Php
body: <p>I'm looking for a simple method to get the first table of a webpage and put the whole thing into a string, that is all.</p>
  
  <p>So I need to know how to use preg_match or similar to get the first instance of a table from a DOM object and get that whole thing into a string:</p>
  
  <p>I have a class to download webpages as DOM but I cannot convert the html to a string as I need it..</p>
  
  <pre><code>$nodes = $this-&gt;bot-&gt;QuerySelector($this-&gt;download['DOM'], "//table[1][@class='tyebfghjftsdf-ccfkk']");
  </code></pre>
  
  <p>Please help</p>