If you want to parse this information for yourself, just give the script an $ip and $port (default assumed) |
then pull an arraylist for $srvinfo from 0-2 to get motd, players online, and max players. |
Server and port are just echo'd $ip and $port. To check online status, use testserver.php. |
Call testserver.php and use the GetServerStatus($ip, $port); function - echo that and done :3 |
Example:
include('http://unps-gama.tk/mcping.php?ip=$ip&port=$port')
echo "Server: " . $ip . " on port: " . $port . " is: ";
include('http://unps-gama.tk/testserver.php');
$status = GetServerStatus($ip, $port);
if ($status=="ONLINE") echo "" . $status . "\n";
if ($status=="OFFLINE") echo "" . $status . "\n";
echo "motd: " . $srvinfo[0] . "\n";
echo "players online: " . $srvinfo[1] . "\n";
echo "max players: " . $srvinfo[2] . "\n"; |