<html>
<! Combine.php                                                >
<! Chapter 6, Oracle Database XE PHP Web Programming          >
<! by Michael McLaughlin                                      >
<!                                                            >
<! This script combines two arrays into single array of equal >
<! key and value pairs.                                       >
<head>
<title>
  Chapter 6 : Combine.php
</title>
</head>
<body>
<?php
  // Declare array variables.
  $countryCode = array("dk","fi","is","no","se");
  $countryName = array("Denmark","Finland","Iceland","Norway","Sweden");

  // Print structured ordering of source arrays.
  print "[Keys][".print_r($countryCode,true)."].<br>";
  print "[Values][".print_r($countryName,true)."]<br><hr>";

  // Combine the arrays as a key and name pair.
  $countryList = array_combine($countryCode,$countryName);

  // Print restructured ordering of key and value pair array.
  foreach($countryList as $code => $name)
    print "[".$code."][".$name."]<br>";
?>
</body>
</html>
