php every sixth row add class
<p>I have a mysql query which selects 18 items from the table, but I'd like it to add a class on every 6th item.</p>

<p>Here's my code:</p>

<pre><code>  $i = 0;
  foreach ($this-&gt;Items as $item) {

    if ($item-&gt;image) { 

            echo '&lt;div class="storeImages"&gt; &lt;img src="/images/store/'.$item-&gt;image.'" width="113" height="153" border="0" alt="'.$item-&gt;name.'" title="'.$item-&gt;name.'" /&gt; &lt;/div&gt;';

    };

 $i++;
 };
</code></pre>

<p>I've tried a couple of different things, but can't seem to get it working, basically on each 6th item, I want to add style="margin-right: 0px;" :)</p>
