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

Answer by kiks73 for Parse Data from JSON URL

You are missing the foreach cycle to fetch the two dimensional array $data:<?php$json = file_get_contents("http://api.bfhstats.com/api/onlinePlayers");$data=array();$data = json_decode($json,...

View Article



Answer by Rakesh Guha for Parse Data from JSON URL

You first call the variable $json but then use $jsondata in json_decode.

View Article

Answer by dudeman for Parse Data from JSON URL

change:$data = json_decode($jsondata, true);to$data = json_decode($json, true);Also, json_decode returns an array so use:echo $data['pc']['peak24'];to access the data.

View Article

Parse Data from JSON URL

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....

View Article
Browsing all 4 articles
Browse latest View live




Latest Images