title: php domdocument parse nested tables
body: <p>I got a table which looks like this: <a href="http://pastebin.com/jjZxeNHF" rel="nofollow">http://pastebin.com/jjZxeNHF</a></p>
  
  <p>I got it as a PHP-DOMDocument.</p>
  
  <p>Now I want to "parse" this table.</p>
  
  <p>If I am correct, something like the following is not going to work because   <code>$superTable-&gt;getElementsByTagName('tr')</code> is not only going to get outer tr's but also the inner ones.</p>
  
  <pre><code>foreach ($superTable-&gt;getElementsByTagName('tr') as $superRow) {
      foreach ($superRow-&gt;getElementsByTagName('td') as $superCol) {
          foreach ($superCol-&gt;getElementsByTagName('table') as $table) {
              foreach ($table-&gt;getElementsByTagName('tr') as $row) {
                  foreach ($row-&gt;getElementsByTagName('td') as $col) {
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>How can I go trough all the tables, field by field, as described in the second snippet.</p>