18 lines
319 B
PHP
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);
|
|
?>
|