Advertisement
Hydrase

PHP Arrays

Jan 24th, 2025
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. $age=array("Jotaro"=>"19","Dio"=>"300","Johnny"=>"19");
  11. echo"Jotaro is".$age['Jotaro']."years old<br>";
  12. echo"Dio is".$age['Dio']."years old<br>";
  13. echo"Johnny is".$age['Johnny']."years old<br>";
  14. $cars=array("Volvo","BMW","Toyota");
  15. echo"<br>I like ",$cars[0],",",$cars[1],",",$cars[2]."<br>";
  16. $cars1=array
  17. (
  18. array("Volvo",22,18),
  19. array("BMW",15,13),
  20. array("Toyota",17,15)
  21. );
  22. echo "<br>".$cars1[0][0]." ".$cars1[0][1].",".$cars1[0][2];
  23. echo "<br>".$cars1[1][0]." ".$cars1[1][1].",".$cars1[1][2];
  24. echo "<br>".$cars1[2][0]." ".$cars1[2][1].",".$cars1[2][2];
  25. ?>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement