Files
intecsync/uebung10/api.php
2019-07-11 13:36:20 +02:00

18 lines
319 B
PHP

<?php
require_once(__DIR__ . '/Database.php');
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
$db = new Database();
$n = 10;
if (isset($_GET['n'])) {
$n = $_GET['n'];
}
$questions = $db->getQuestions($n);
$questionsobj = json_encode($questions);
echo($questionsobj);
?>