Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, April 26, 2013

Codecademy Sample Solution: Putting it All Together



<html>
  <head>
    <title>I am the King of Arrays!</title>
  </head>
  <body>
    <p>
      <?php
      // On the line below, create your own associative array:
      $myArray = array('feet'=>'shoes', 'hands'=>'gloves', 'head'=>'hat');

      // On the line below, output one of the values to the page:
      print $myArray['head']."<br/>";
         
      // On the line below, loop through the array and output
      // *all* of the values to the page:
      foreach($myArray as $key => $value){
          print $key .'=&gt;'. $value."<br/>";
      }
   
      ?>
    </p>
  </body>
</html>

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts