Advertisement
Guest User

Codeacademy Question

a guest
Oct 9th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <title>I am the King of Arrays!</title>
  4.   </head>
  5.   <body>
  6.     <p>
  7.       <?php
  8.       // On the line below, create your own associative array:
  9.       $myArray = array("LOL" => "Laugh out loud!", "FYI" => "For your information");
  10.  
  11.       // On the line below, output one of the values to the page:
  12.      echo $myArray["LOL"] . "<br>";
  13.          
  14.       // On the line below, loop through the array and output
  15.       // *all* of the values to the page:
  16.      foreach ($myArray as $abriv=>$ext) {
  17.          echo $abriv . " means " . $ext . "<br>";
  18.      }
  19.       ?>
  20.     </p>
  21.   </body>
  22. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement