【发布时间】:2017-08-17 20:17:50
【问题描述】:
我需要从这里https://use.gameapis.net/mc/query/info/play.mineverge.net获取JSON数据
我需要“在线”:126 显示在我的网页中。
"players": {
"online": 126,
"max": 500
这是我当前获取 JSON 的代码(不工作)。难道我做错了什么?它显示所有内容,而不仅仅是“在线”:
$playeronline = file_get_contents ('https://use.gameapis.net/mc/query/info/' . $server);
echo $playeronline->players[1];
echo $playeronline['online'];
【问题讨论】: