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

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

  // Read and add array keys and values to a string.
  for ($i = 0; $i < count($salutation); $i++)
    $output .= " [".$i."] => ".$salutation[$i];

  // Append closing parenthesis.
  $output .= " )";

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