It looks like what you're really trying to do is alternate what you're doing through the loop.
for instance, let's say we wanted to count to 12, and alternate between doing two things. We could do this:
for ($i=0;$i<12;$i++){
if ($i%2==0){
Do even numbered stuff...
print $something_even;
}else{
Do odd numbered stuff
print $something_odd;
}
}
In the above we use the % operator, which is the mod, or remainder of a division operator.
Note that you could do the assignment you wanted in the if/else blocks above.