Advertisement
rkhaidir16

Array 1

Oct 5th, 2023 (edited)
1,003
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | Source Code | 0 0
  1. <?php
  2.  
  3. $array = [
  4.   ["A", "B", "E"],
  5.   ["C", "D", "F"]
  6. ];
  7.  
  8. // $nama_variabel[baris][kolom]
  9. echo $array[0][0];
  10. echo $array[0][1];
  11. echo $array[1][0];
  12. echo $array[0][2];
  13. echo $array[1][2];
  14.  
  15. echo "<table>";
  16. echo "<tr>";
  17. echo "<td>" . $array[0][0] ."</td>";
  18. echo "<td>" . $array[0][1] ."</td>";
  19. echo "</tr>";
  20.  
  21. echo "<tr>";
  22. echo "<td>" . $array[1][0] ."</td>";
  23. echo "<td>" . $array[1][1] ."</td>";
  24. echo "</tr>";
  25. echo "</table>";
  26.  
  27. echo "
  28. <table>
  29.     <tr>
  30.         <td>" . $array[0][0] . "</td>
  31.         <td>" . $array[0][1] . "</td>
  32.         <td>" . $array[0][2] . "</td>
  33.     </tr>
  34.  <tr>
  35.    <td>" . $array[1][0] . "</td>
  36.    <td>" . $array[1][1] . "</td>
  37.    <td>" . $array[1][2] . "</td>
  38.  </tr>
  39. </table>
  40. ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement