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

Answer by kiks73 for Parse Data from JSON URL

$
0
0

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, true);//print_r ($data);foreach ($data as $pc) {     echo $pc["peak24"]."<br>";}?>

Check the $json and $jsondata that have different name but should be the same.


Viewing all articles
Browse latest Browse all 4

Trending Articles



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