sveltekit-api-julia/www/public/api/posts.php

17 lines
335 B
PHP
Raw Permalink Normal View History

2022-11-14 20:41:41 +00:00
<?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);