diff --git a/api/answer.php b/api/answer.php index ba4b0c0..05e61a7 100644 --- a/api/answer.php +++ b/api/answer.php @@ -10,6 +10,13 @@ requireLogin(); $user = $_SESSION['user']; +function normalize(string $s): string +{ + $s = strtolower(trim($s)); + $s = preg_replace('/\s+/', ' ', $s); + return $s; +} + $input = json_decode(file_get_contents('php://input'), true); $lang = $input['lang'];