Answer the question
In order to leave comments, you need to log in
How to get JSON response?
This code should receive JSON and then decode it, and output it online to site.ru/?online. So why doesn't it work?
$server = @file_get_contents('http://api.minetools.eu/ping/lobby.freecraft.eu/25565');
$tree = json_decode($server);
if(isset($_REQUEST['online'])){
exit("{$tree['players']['online']}");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question