<html>
<! ArraySearch2.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_search function to search and return a     >
<! matching value of the same data type from the array.       >
<head>
<title>
  Chapter 6 : ArraySearch2.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>";

  // Print the value pointed to by the index key.
  print "[".$salutation[array_search("Dr.",$salutation,true)]."]";

  // Return the keys into an array.
  $result = array_search("Dr.",$salutation,true);

?>
</body>
</html>
