I am trying to parse and list a json file. I have it as Unicode-8 without specification. The file is working. Structure:
// "games.json" : // {"data":[ // {"game":"5359","Date":"07/08/2015"}, // {"game":"5355","Date":"10/20/2007"}, .... <?php // copy file content into a string var $jsondata = file_get_contents("games.json"); // convert the string to a json object $json = json_decode($jsondata,true); var_dump($json); // DW! foreach($json["data"] as $data_X) {echo $data_X->game;} ?>
Why is this not working?
source share