Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Array 2D dan Looping</title>
- <style type="text/css">
- body{
- background-color: gainsboro;
- font-family: verdana;
- font-size: 20px;
- }
- </style>
- </head>
- <body>
- <?php
- $siswa = array(array("1314114590","Tony","MIF1"), array("1314114592","Thor","MIF2"), array("1314114593","Bruce","MIF3"));
- echo '<table border=1 cellspacing=3 cellpadding=3>
- <tr>
- <th>NIS</th>
- <th>NAMA</th>
- <th>KELAS</th>
- </tr>';
- for ($i=0; $i < 3; $i++) {
- echo '<tr>';
- for ($j=0; $j < 3; $j++) {
- echo'<td>'.$siswa[$i][$j].'</td>';
- }
- echo '</tr>';
- }
- echo "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement