1200, "msg" => "OK"); $catalog = array(); $datasets = file("AMDA_HAPI.list"); foreach ($datasets as $dataset) { $catalog[] = array("id" => str_replace("\n","",$dataset)); } $response["catalog"] = $catalog; header('Content-Type: application/json'); header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: GET"); exit(json_encode($response)); ?>