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.