//for |
for ( $j =1; $j <=9; $j ++){ |
for ( $i =1; $i <= $j ; $i ++){ |
// echo {$i}*{$j}=.($i*$j)." "; |
echo "{$i}*{$j}=" .( $i * $j ). " " ; |
} |
echo "<br />" ; |
} |
//while |
$j =1; |
while ( $j <=9){ |
$i =1; |
while ( $i <= $j ){ |
echo "{$i}*{$j}=" .( $i * $j ). ' ' ; |
$i ++; |
} |
echo "<br />" ; |
$j ++; |
} |
//do..while |
$j =1; |
do { |
$i =1; |
do { |
echo "{$i}*{$j}=" .( $i * $j ). ' ' ; |
$i ++; |
} while ( $i <= $j ); |
echo '<br />' ; |
$j ++; |
} while ( $j <=9); |