I use ParseHub to get data from an Ajax-based website. The data is returned in json file format. I have been struggling to print returned json file for hours, but could not be successful. Here is my php code:
<?php
header('Content-Type: application/json;charset=utf-8');
$params = http_build_query(array(
"api_key" => "xxxxx",
"format" => "json"
));
$result = file_get_contents(
'https://www.parsehub.com/api/v2/projects/{MY_RUN_TOKEN}/last_ready_run/data?'.$params,
false,
stream_context_create(array(
'http' => array(
'method' => 'GET'
)
))
);
echo $result;
?>
By the way, json_decode() function didn't work. Can anyone help me?
UPDATE: I uploaded code and output of the code. You can check to give some ideas.