I have the following foreach
foreach( $array as $v )
{
if( SOME LOGIC HERE ) $class = "first";
if( SOME LOGIC HERE ) $class2 = "third";
print '<span class="$class $class2">$v["name"]</span>';
}
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