title: PHP foreach with table rows
body: <p>I have this PHP script here</p>
  
  <pre><code>$z = range(2, 123);
  echo '&lt;table width="100%"&gt;';
  foreach($z as $x){
  
  echo '&lt;td&gt;&lt;a href="http://www.mysite.net/' . $x . '/"&gt;&lt;img src="http://www.mysite.net/' . $x . '/5.jpg" width=200&gt;&lt;/a&gt;&lt;/td&gt;';
  }
  
  echo '&lt;/table&gt;';
  </code></pre>
  
  <p>What I am trying to do is get 6 items in the table row and then a new row...how would I do this?</p>
  
  <p>Thanks,
  J</p>