From 1d6620f4da9ddad5be825c0b7e221a105760b75e Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Tue, 1 Jul 2014 09:53:36 +0200 Subject: [PATCH] eigentliche Rechtschreibkorrektur --- main.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 main.php diff --git a/main.php b/main.php new file mode 100644 index 0000000..0f35729 --- /dev/null +++ b/main.php @@ -0,0 +1,37 @@ + + + + + + haupt + + + + +query("SELECT id FROM `unileipzig-en`,`unileipzig-de` WHERE wort='$falscheswort'"); +if($vorhanden->num_rows ==1) { + echo "

Das Wort ist richtig

"; + exit; +} +$ergebnis = $mysqli->query("SELECT wort FROM `unileipzig-en`,`unileipzig-de`"); +// echo "\n"; +$arrayahnlich =array(); // leeres Array erstellen +while ($wort = $ergebnis->fetch_array()) { + $ahnlichkeit=levenshtein($falscheswort, $wort[0]); +// echo ""; + $arrayahnlich[$wort[0]] = $ahnlichkeit; +} +asort($arrayahnlich); +$top = array_keys($arrayahnlich); +echo "$top[0],$top[1],$top[2],$top[3]"; + +?> +
$wort[0]$ahnlichkeit
+ +