<table border="1px">
<?php
for ($c=1;$c<=9;$c++){
echo "<tr>";
for ($d=$c;$d<=9;$d++){
echo "<td align='right'>";
echo $c."x".$d."=".$c*$d." ";
echo "</td>";
}
echo "</tr>";
echo "<tr/><tr/>";
}
?>
</table>
首先可以看出$c输出9行,然后第1行$d输出9列,每一列的值为$c*$d,第2行$d输出8列,每一列的值为$c*$d,以此类推,第9行$d输出1列,形成九九乘法表!