false, "user" => null ]; if (isset($_GET["key"])) { if (in_array($_GET["key"], $list)) { $obj["valid"] = true; foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens"), function ($i) { return !str_starts_with($i, "."); }) as $token) { $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . $token), true); $obj["user"] = $data["login"]; } } } die(json_encode($obj));