php 9x9乘法表

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

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

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

http://1kul.cn/taobao