課題
04.loops/loop2.php
- 表示
- ソース
-
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8" /> <title>多重ループ</title> </head> <body> <h1>多重ループ</h1> <?php for($i = 0; $i < 10; $i++){ for($j = 0; $j < 10; $j++){ print "[{$i}{$j}]"; } print '<br>'; } ?> <hr> <?php for($i = 9; $i >= 0; $i--){ for($j = 0; $j < $i; $j++){ print "[{$i}{$j}]"; } print '<br>'; } ?> <hr> <?php for($i = 9; $i >= 0; $i--){ for($j = 9; $j > $i; $j--){ print "[{$i}{$j}]"; } print '<br>'; } ?> </body> </html>