The online racing simulator
Server info with player list and etc
If I post in wrong forum sorry.
I need server status with player list, what car allowed, what track.
I need it in PHP script. Maybe u know where to find it? I have found this: http://sourceforge.net/project ... _Release_1.9.zip/download but I dont really know how to config it. Sorry for my english, please help me.
Usage: http://www.lfsworld.net/hoststatus/?h={your server name} .
Example: http://www.lfsworld.net/hoststatus/?h=[TC]%20CityDriving%20One . You can get it in PHP file with this code:

<?php
function GetInformation($name, $output)
{
if ($name == "Players")
{
$output = explode('<div id="Users" class="DataCont"><div class="Field3">', $output);
$output = str_replace('</a>', '', $output[1]);
$output = preg_replace('/<a class="User" href="(.*?)" target="_blank">/i', '$2', $output);
}
else
{
$output = explode('<div id="'.$name.'" class="DataCont">', $output);
$output = explode('</div>', $output[1]);
$output = str_replace('<div class="Field2">', '', $output[1]);
}
return $output;
}

//Variables
$info = array("Track" => "", "Cars" => "", "Version" => "", "Conns" => "", "Players" => "");
$hostname = "[TC]%20CityDriving%20One"; //Change to your server hostname
$time_start = microtime(true);
// Get contents from website url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lfsworld.net/hoststatus/?h=".$hostname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
// Set contents into array
foreach ($info as $name => &$value)
{
$info[$name] = GetInformation($name, $output);
}
// Show information from array
echo "<pre>";
print_r($info);
echo "</pre>";

//Script execution time
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Script executed in ".$time." seconds";
?>

Quote from geekas :Usage: http://www.lfsworld.net/hoststatus/?h={your server name} .
Example: http://www.lfsworld.net/hoststatus/?h=[TC]%20CityDriving%20One . You can get it in PHP file with this code:

<?php
function GetInformation($name, $output)
{
if ($name == "Players")
{
$output = explode('<div id="Users" class="DataCont"><div class="Field3">', $output);
$output = str_replace('</a>', '', $output[1]);
$output = preg_replace('/<a class="User" href="(.*?)" target="_blank">/i', '$2', $output);
}
else
{
$output = explode('<div id="'.$name.'" class="DataCont">', $output);
$output = explode('</div>', $output[1]);
$output = str_replace('<div class="Field2">', '', $output[1]);
}
return $output;
}

//Variables
$info = array("Track" => "", "Cars" => "", "Version" => "", "Conns" => "", "Players" => "");
$hostname = "[TC]%20CityDriving%20One"; //Change to your server hostname
$time_start = microtime(true);
// Get contents from website url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lfsworld.net/hoststatus/?h=".$hostname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
// Set contents into array
foreach ($info as $name => &$value)
{
$info[$name] = GetInformation($name, $output);
}
// Show information from array
echo "<pre>";
print_r($info);
echo "</pre>";

//Script execution time
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Script executed in ".$time." seconds";
?>


This code, dont working fine.
According to your screenshot it works perfectly fine.

The thing is what you try to say is that you have no idea what it does

FGED GREDG RDFGDR GSFDG