400, "message" => "Missing query type or attributs."))); exit(); } $author_name = $_GET['author']; $q = $_GET['q']; $json_object = match ($q) { "theses" => dump::getTheseByAuthor($author_name), "authors" => dump::getAuthorsByAuthors($author_name), default => NULL, }; $json = json_encode($json_object); print_r($json);