Quantcast
Channel: Parse Data from JSON URL - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Parse Data from JSON URL

$
0
0

I'm trying to get data onto my website by parsing data from a JSON format. The URL is http://api.bfhstats.com/api/onlinePlayers and I'm trying to output for example the currently players online on PC.

Here's the current code I have:

<?$json = file_get_contents("http://api.bfhstats.com/api/onlinePlayers");$data = json_decode($jsondata, true);echo $data->pc->peak24;?>

I thought this would work, however it's not displaying anything. I am very new to parsing JSON data so if someone could explain what I'm doing wrong that would be brilliant.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>