<html>
<! Ksort1.php                                                 >
<! Chapter 6, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script declares an array and sorts it with the        >
<! ksort() function before and after the sort operation.      >
<head>
<title>
  Chapter 6 : Ksort1.php
</title>
</head>
<body>
<?php
  // Declare variable.
  $salutation = array("Mr.","Ms.","Mrs.","Dr.");

  // Print structured ordering.
  print "[".print_r($salutation,true)."].<br>";

  // Sort the array members.
  asort($salutation);

  // Print restructured ordering.
  print "[".print_r($salutation,true)."].<br>";

  // Sort the array members.
  ksort($salutation);

  // Print restored ordering.
  print "[".print_r($salutation,true)."].<br>";
?>
</body>
</html>
