<?php
/***for循环9*9乘法表***/
for ($i = 1; $i <= 9; $i++) {
for ($j = 1; $j <= $i; $j++) {
echo "$i X $j = " . ($i * $j);
echo "  ";
}
echo "<br />";
}
echo "<hr />";
/***while循环乘法表***/
$i = 1;
while ($i <= 9) {
$j = 1;
while ($j <= $i) {
echo "$i X $j = " . ($i * $j);
echo "  ";
$j++;
}
echo "<br />";
$i++;
}
echo "<hr />";
/***do-while循环9*9乘法表***/
$i = 1;
do {
$j = 1;
do {
echo "$i X $j = " . ($i * $j);
echo "  ";
$j++;
} while ($j <= $i);
echo "<br />";
$i++;
} while ($i <= 9);
?>