Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = 'http://mcapi.ca/query/server/players';
- $json = file_get_contents($link);
- $json = json_decode($json, true);
- $on = $json['status'] == 'true';
- if($on){
- $players = $json['players']['online'];
- $players = intval($players);
- echo $players.' players online no MysticCraft';
- }else{
- echo 'O servidor estΓ‘ offline';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement