<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8"/>
<title>Similar Names</title>
<link href="stylesheets/chinese_zodiac_styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
  <div class="header">
    <?php include("includes/inc_header.php"); ?>
  </div>
  <div class="content"><br /><br /> 
    <h1>Similar Names</h1><hr />
  
    <?php
      $SignNames = array("Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig");
      $LevenshteinSmallest = 999999;
      $SimilarTextLargest = 0;
      for ($i = 0; $i < 11; ++$i) {
          for ($j = $i + 1; $j < 12; ++$j) {
              $LevenshteinValue = levenshtein($SignNames[$i], $SignNames[$j]);
              if ($LevenshteinValue < $LevenshteinSmallest) {
                  $LevenshteinSmallest = $LevenshteinValue;
                  $LevenshteinWord1 = $SignNames[$i];
                  $LevenshteinWord2 = $SignNames[$j];
              }
              $SimilarTextValue = similar_text($SignNames[$i], $SignNames[$j]);
              if ($SimilarTextValue > $SimilarTextLargest) {
                  $SimilarTextLargest = $SimilarTextValue;
                  $SimilarTextWord1 = $SignNames[$i];
                  $SimilarTextWord2 = $SignNames[$j];
              }
          }
      }
      echo "<p>The levenshtein() function has determined that "$LevenshteinWord1" and
              "$LevenshteinWord2" are the most similar names.<?p>\n";
      echo "<p>The similar_text() function has determined that "$SimilarTextWord1" and
            "$SimilarTextWord2" are the most similar names.</p>\n"
      ?>
  
    </div>
    <div class="footer"> 
      <?php include("includes/inc_footer.php"); ?>
    </div>
</div>
</body>
</html>