title: Grab first <tr> & <a> if <table> contains <a>
body: <p>I'm stuck on a Simple HTML Dom question... </p>
  
  <p>For each <code>&lt;table&gt;</code> on my webpage I'd like to scan the <code>&lt;table&gt;</code> and check if there is an <code>&lt;a&gt;</code> inside of it. If there is, then echo the first <code>&lt;tr&gt;</code> and <code>&lt;a&gt;</code> else skip and go on to the end <code>&lt;table&gt;</code>.</p>
  
  <p>I started working on it but I'm unsure how to progress or check if there is a <code>&lt;a&gt;</code> in the table... </p>
  
  <pre><code>foreach ($html-&gt;find('table') as $name) {
      foreach ($name-&gt;find('a') as $elem) {
          echo $elem-&gt;plaintext.'&lt;br&gt;';
      }
  }
  </code></pre>
  
  <p>Any ideas?</p>