<html>
<! Array4.php                                                 >
<! Chapter 6, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This declares a numeric array and assigns all elements     >
<! at once then it uses a foreach-loop to mimic the print_r() >
<! function.                                                  >
<head>
<title>
  Chapter 6 : Array4.php
</title>
</head>
<body>
<?php
  // Declare variable.
  $salutation = array("Dr.","Mr.","Mrs.","Ms.");

  // Remove a key and value pair from an array.
  unset($salutation[2]);

  // Declare a starting string variable.
  $output = "Array ( ";

  // Read and add array keys and values to a string.
  foreach ($salutation as $hashName => $hashValue)
      $output .= " [".$hashName."] => ".$hashValue;

  // Append trailing closed parenthesis.
  $output .= " )";

  // Print the formatted contents.
  print "[".$output."].";
?>
</body>
</html>
