Quote:
Originally Posted by NullPointer
Does that mean when i is equal to 4 do what is in the body of the if statement, or when it is 3? In a month from now looking back at this code will you be able to tell?
|
Yes, I will. 
($i++ == 4) will first compare $i to 4, and then increment $i. However, of course it should have been 3 instead of 4, as Aaron pointed out.
I guess your looking for something like this instead Matt, in order to not do one increase more than necessary?
PHP Code:
$i = 0; while (...) { echo '<td>' . $row['name'] . '</td>'; if ($i == 3) { $i = 0; echo '</tr><tr>'; } else { $i++; } }
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
|