Baffling output

From: Date: Thu, 02 Jan 2003 22:25:23 +0000
Subject: Baffling output
Groups: php.general 
Request: Send a blank email to php-general+get-130003@lists.php.net to get a copy of this message
Can someone explain to me why the loop that counts to 99 appears before the 5 by 5 grid in the following php code? Thanks! <?php echo "<table border=\"1\" align=\"center\" width=\"100%\" bgcolor=\"#FFFFFF\" bordercolor=\"#FFFFFF\"><tr>"; for ($r=0; $r<5; $r++){ for ($c=0; $c<7; $c++){ if ($c==0 || $c%7==0) echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" bordercolor=\"#000000\"></td>"; else if ($c%6==0) echo "<td align=\"center\" valign=\"middle\" width=\"14%\" height=\"77\" bordercolor=\"#000000\"></td></tr><tr>"; else { echo "<td align=\"center\" valign=\"middle\" width=\"15%\" height=\"77\" border=\"1\" bordercolor=\"#000000\">"; echo "<div align=\"center\"><font size=\"1\"></font></div>"; echo "Hello" ; $i++; } //for else }// for loop c } //for loop r for ($i=1; $i<100; $i++) echo "$i<br>\n"; ?>

« previous php.general (#130003) next »