studi - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of studi.php

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  <title>Studi Kasus</title>
  5.  <style>
  6.   th{
  7.    background-color: cyan;
  8.    border: 1px solid orange;
  9.   }
  10.   td{
  11.    background-color: gewwn;
  12.    border: 1px solid salmon;
  13.   }
  14.   body{
  15.    background-color: lightgrey;
  16.   }
  17.  </style>
  18. </head>
  19. <body>
  20.  <table border="1" cellpadding="5" align="center">
  21. <tr>
  22.    <th>NIS</th>
  23.    <th>Nama</th>
  24.    <th>Kelas</th>
  25.    <th>Jurusan</th>
  26.   </tr>
  27. <?php $siswa = [
  28.    ['NIS' => '1314115690',
  29.    'Nama' => 'Bruce Banner',
  30.    'Kelas' => 'MIF1',
  31.    'Jurusan' => 'MIF'],
  32.    ['NIS' => '1314115692',
  33.    'Nama' => 'Stephen Strange',
  34.    'Kelas' => 'MIF2',
  35.    'Jurusan' => 'MIF'],
  36.    ['NIS' => '1314115692',
  37.    'Nama' => 'Stephen Strange',
  38.    'Kelas' => 'MIF2',
  39.    'Jurusan' => 'MIF'],
  40.    ['NIS' => '1314115692',
  41.    'Nama' => 'Stephen Strange',
  42.    'Kelas' => 'MIF2',
  43.    'Jurusan' => 'MIF']
  44.  
  45.  
  46.   ];
  47.  
  48.   for ($i=0; $i < 4 ; $i++) { 
  49.  
  50.    echo "<tr>";
  51.    echo "<td>" . $siswa[$i]['NIS'] . "</td>";
  52.    echo "<td>" . $siswa[$i]['Nama'] . "</td>";
  53.    echo "<td>" . $siswa[$i]['Kelas'] . "</td>";
  54.    echo "<td>" . $siswa[$i]['Jurusan'] . "</td>";
  55.    echo "</tr>
  56. ";
  57.   }
  58.  
  59.   ?>
  60.  </table>
  61. </body>
  62. </html>
File Description
  • studi
  • PHP Code
  • 29 Oct-2019
  • 1.17 Kb
You can Share it: