title: Build array from parsed HTML table
body: <p>I've just started trying to teach myself PHP and need a little help.  Using DOM, I'm trying to parse an HTML table to put the results into a MySQL dbase, but am having problems.
  I am able to echo each row of the table with this:</p>
  
  <pre><code>foreach ($html-&gt;find('table') as $table)
  foreach ($table-&gt;find("tr") as $rows)
      echo $rows."&lt;br /&gt;";
  </code></pre>
  
  <p>The data has this structure:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;a href=http://some link&gt;text1&lt;/a&gt;
  &lt;td class="..."&gt;text2&lt;/td&gt;
  &lt;td class="..."&gt;text3&lt;/td&gt;
  &lt;td class="..."&gt;text4&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I'm trying to get the link and text1-4 into an array, but can't figure it out.  Any help would be appreciated.
  --Edit--<br>
  This is the table layout that I'm trying to break down.</p>
  
  <pre><code>&lt;tr&gt;
  &lt;th class="school first"&gt;
      &lt;ahref="/local/team/home.aspx?schoolid=472d8593"&gt;Aberdeen&lt;/a&gt;
  &lt;/th&gt;
  &lt;td class="mascot"&gt;Bulldogs&lt;/td&gt;
  &lt;td class="city"&gt;Aberdeen&lt;/td&gt;
  &lt;td class="state last"&gt;MS&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>jnpcl's answer gives me this</p>
  
  <pre><code>  ROW
    TEXT: Bulldogs
    TEXT: Aberdeen
    TEXT: MS
  </code></pre>
  
  <p>but no link.  I probably wasn't specific enough in my original question, but, like I said, I'm trying to learn, and I usually do it by jumping in the deep end of the pool.</p>