sveltekit-api-julia/www/public/api/posts.php
2022-11-14 21:41:41 +01:00

17 lines
335 B
PHP

<?php
$user["name"] = "Henrik";
$user["age"] = 11;
$response[] = $user;
$user["name"] = "Eva";
$user["age"] = 14;
$response[] = $user;
$user["name"] = "Lisa";
$user["age"] = 15;
$response[] = $user;
header('Access-Control-Allow-Origin: *'); // http://localhost
header('Content-Type: application/json');
echo json_encode($response);