$url="https://alcurex.com/api/market.php?pair=mrc_ltc&price=buy";
$json = file_get_contents($url);
$data = json_decode($json);
echo $json;
var_dump($data);
Results in a null response. However when you visit the page you get a html read out of
{
"pair": MRC_LTC,
"time": "2014-07-23 07:34:54,
"price": 0.00000017,
"volume": 558.99741176,
"type": Buy
},
Response is not valid JSON format.
{ "pair": MRC_LTC, "time": "2014-07-23 07:34:54, "price": 0.00000017, "volume": 558.99741176, "type": Buy },
You could check it from Firefox console, correct JSON should be this:
var s = {
"pair": "MRC_LTC",
"time": "2014-07-23 07:34:54",
"price": 0.00000017,
"volume": 558.99741176,
"type": "Buy"
};
Errors:
You have three problems with this JSON:
This is a valid JSON:
{
"pair": "MRC_LTC",
"time": "2014-07-23 07:34:54",
"price": 0.00000017,
"volume": 558.99741176,
"type": "Buy"
}