<html>
<! ArrayKeysExists.php                                        >
<! Chapter 6, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This declares an array by assigning all elements, then     >
<! it uses a array_key_exists function to search and return   >
<! a key from the list of index keys in the array.            >
<head>
<title>
  Chapter 6 : ArrayKeysExists.php
</title>
</head>
<body>
<?php
  // Declare an array variable.
  $salutation = array("Dr.","Mr.","Mrs.","Ms.");

  // Print the formatted contents.
  print "[".(print_r($salutation,true))."].<p>";

  // Declare index search key.
  $search = 3;

  // Verify the key and then return the value.
  if (array_key_exists($search,$salutation))
    print "[".$salutation[$search]."].";

?>
</body>
</html>
