<?php
echo '<h1>while循环输出九九乘法表<h1>';
$i=1;
while ($i<=9) {
$j=1;
while ($j<=$i) {
echo "$j*$i=".($j*$i);
echo " ";
$j++;
}
echo '<br>';
$i++;
}
//for循环输出九九乘法表
echo 'for循环输出九九乘法表';
echo "<hr>";
for ($a=1; $a<=9 ; $a++) {
for ($b=1; $b<=$a ; $b++) {
echo "$b*$a=".($a*$b);
echo " ";
}
echo "<br>";
}
?>