PHP中for循环实现九九乘法表
以下是具体的代码实现部分:
<?php
/*
/* 打印乘法口诀表 */
*/
echo "<table border=\"1\">\n<tr><td>九宫格乘法口诀表</td></tr>\n";
";
echo "<tr>";
<table>";
for($i=1;$i<=9;$i++){
echo "<tr>";
for($j=1;$j<=$i;$j++){
echo "<td>".$j."*".$i."=".($j*$i)."</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</tr>\n";
";
echo "</table>";
<table>";
for($i=1;$i<=9;$i++){
echo "<tr>";
for($j=$i;$j<=9;$j++){
echo "<td>".$i."*".$j."=".($j*$i)."</td>";
}
echo "</tr>";
}
echo "</table>";
?>