Location: PHPKode > scripts > TeeWorlds Server Stats > teeworlds-server-stats/examples/console.php
<?php

require ("../TeeWorldsServer.php");

$server = new TeeWorldsServer("YOUR SERVER IP");

if ($server->queryServer() !== FALSE)
{
    print "Server name: {$server->getName()}\n";
    print "Server version: {$server->getVersion()}\n";
    print "Ping: {$server->getPing()}\n";
    print "Gametype: {$server->getGametype()}\n";
    print "Map: {$server->getMap()}\n";
    print "Players: {$server->getPlayerCount()} / {$server->getMaxPlayers()}\n";
    print "Player list:\n";

    foreach ($server->getPlayers() as $player)
    {
        print "{$player->getName()} | {$player->getScore()}\n";
    }
}
else
{
    print "Couldn't query the server";
}

?>
Return current item: TeeWorlds Server Stats