topogigiovanni
4/21/2019 - 8:05 PM

json php

retorna um json com allow origin em PHP

<?php
$data = '';
$id = $_GET['id'];
if(!is_null($id)){
	$url = "http://104.236.76.114:5001/static/integrations/$id.json";
	$data = file_get_contents($url);
	$data = json_decode($data);
}

header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');  

echo json_encode($data);