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

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

$server = new SoldatServer("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 "Rules:\n";

    foreach ($server->getRules() as $key => $value)
    {
        print "\t$key: $value\n";
    }

    print "Players: {$server->getPlayerCount()} / {$server->getMaxPlayers()}\n";
    print "Player list:\n";

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

?>
Return current item: Soldat Server Stats