xxxxxxxxxx
/* If this distance is less than the next found shortest distance,
<html lang="en">
<head>
<meta charset="utf-8">
<title>Find Closest Match of a Misspelled Word in PHP</title>
</head>
<body>
// Misspelled word
$input = "calender";
// Array of words to check against
$words = array("seize", "calendar", "foreign", "category", "quiet");
// No shortest distance found yet
$shortest = -1;
// Loop through words to find the closest
foreach($words as $word){