I am trying to retrieve data from a server which usually returns it in XML
, however I trying to request it in a JSON format (if requested correctly it will return the data in JSON
).
$header = array(
'http' => array(
'header'=>"Content-type: application/json"
),
);
$response = file_get_contents($query, false, $header);
print_r($response);
This approach was taken from here. Currently the program does not return anything. Does anyone spot any potential problems with this?