<html>
<body>
<h1>Nested Loops</h1>
<h2>Printing a 10 by 10 matrix</h2>
<?php
for ($row=1; $row <= 10; $row++) //loop for 10 rows
{
for ($col=1; $col <= 10; $col++) //loop for 10 columns
{
print " $col ";
}
print "<br /> \n";
}
?>
<h2>Printing a 10 by 10 matrix in an HTML table</h2>
<?php
print "<table border=1 bgcolor=tan>";
for ($row=1; $row <= 10; $row++) //loop for 10 rows
{
print "<tr>";
for ($col=1; $col <= 10; $col++) //loop for 10 columns
{
print " <td> $col </td>";
}
print "</tr> \n";
}
print "</table>";
?>
<?php include "zCode/include.php"; ?> <!-- hyperlink to see the code -->
</body>
</html>