<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 .'=>'. $value."<br/>";
}
?>
</p>
</body>
</html>
No comments:
Post a Comment