title: Count the rows in a html table using php
body: <p>I am looping through a html file using <code>htmldomparsing</code> looking for a table e.g</p>
  
  <pre><code>foreach($html-&gt;find('table') as $table)
  {
    foreach($table-&gt;find('tr') as $tr)
    {
      $count = count($tr);
      $test = explode(" ",$count);
      echo $count;
    }
   }
  </code></pre>
  
  <p>I am trying to count the number of rows in the table, but everytime I use the <code>count function</code> it returns: <code>1111111</code> etc.</p>
  
  <p>When counting the rows , is there any way I can count each row and the count would increment rather than throw out "1111...." etc.
  Any ideas?</p>