JSON data word Max interfering with PHP -


i using php decode json data https://use.gameapis.net/mc/query/info/play.mineverge.net code works fine , json data fine although when try players: max: not load page.

working json code online players:

$playersonline->players->online; 

not working code because max interfers php

$playersonline->players->max; 

so in short max interferes php do?

you need parse json arrays passing true second argument in json_decode.

$json = file_get_contents("https://use.gameapis.net/mc/query/info/play.mineverge.net"); $data = json_decode($json, true); echo $data['players']['max']; 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -