Mega Code Archive

 
Categories / Php / Statement
 

Nesting Two for Loops

<html> <head><title>Nesting Two for Loops</title></head> <body> <div> <?php     print "<table>";     for ( $y=1; $y<=12; $y++ ) {       print "<tr>";       for ( $x=1; $x<=12; $x++ ) {         print "<td>";         print ($x*$y);         print "</td>";       }       print "</tr>";     }     print "</table>"; ?> </div> </body> </html>