How do I find the 1st and 3rd columns from a 3byX grid
<p>I have the following foreach</p>

<pre><code>foreach( $array as $v )
{
    if( SOME LOGIC HERE ) $class = "first";
    if( SOME LOGIC HERE ) $class2 = "third";
        print '&lt;span class="$class $class2"&gt;$v["name"]&lt;/span&gt;';
} 
</code></pre>

<p>I want to set $class1 to be 'third' for every 1st, 4th, 7th, 10th (3n - 2) and $class2 to be set to 'third' for 3rd, 6th, 9th, 12th  </p>
