Nesting Two for Loops : For : Language Basics PHP Source Code


PHP Source Code » Language Basics » For »

 

Nesting Two for Loops



<html>
<head>
<title>Nesting Two for Loops</title>
</head>
<body>
<?php
print "<table>n";
for $y=1; $y<=12; $y++ ){
    print "<tr>n";

    for $x=1; $x<=12; $x++ ) {
        print "t<td>";
        print ($x*$y);
        print "</td>n";
    }
    print "</tr>n";
}
print "</table>";
?>
</body>
 </html>

           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Language Basics
» For