while,for循环输出九九乘法表
<?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>";
}
?>
勤学似春起之苗,不见其增,日有所长; 辍学如磨刀之石,不见其损,日所有亏!