Assuming shortest is required, the following 2 results were found.
$didyoumean_words_array=array(); foreach ($terms as $term) { $term=strtolower($term); # get closest word by LEVENSHTEIN $shortest = -1; foreach ($levenshtein_words as $word) { $lev = levenshtein($term, $word); if ($lev == 0) { $closest = $word;...
although I usually get MySQL to do the date/time calculations, there are times when we have to do with PHP. This is the shortest way I know to properly convert seconds into total hours, minutes and seconds (taking into account regional settings and...