$urlEngine = "http://www.gametiger.com/search?player=%3C+R.A.F+&game=cstrike";
function findPlayers()
{
GLOBAL $urlEngine;
$fp = @fopen($urlEngine,"r");
if($fp)
{
while ($line=fgets($fp,1000))
{
$data .= $line;
}
fclose ($fp);
}
else
return "error";
$tmp = explode("<!-- cstiger results -->",$data);
$data = $tmp[1];
$tmp = explode("<!-- /cstiger results -->",$data);
$data = $tmp[0];
$data = explode("</td></tr>", $data);
$players = array();
if(strpos($data[1], "no such player online"))
return "noplayers";
for($i = 1; $i < count($data) - 1; $i++)
{
$line = $data[$i];
$line = str_replace("<tr ><td>", "", $line);
$line = eregi_replace("(<a href=/)(connect|search)(\?[a-z]+=)([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]+)*(>)", "", $line);
$line = str_replace("</td><td>", "%%%", $line);
$line = str_replace("</a></td><td align=right>", "%%%", $line);
$line = str_replace("&game=cstrike", "", $line);
$line = eregi_replace("(<a href=/)(connect|search)(\?[a-z]+=)([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}:[0-9]+)*(>)", "", $line);
$line = str_replace("</td><td align=right>cstrike&nbsp;1.6</td><td align=right>", "%%%", $line);
$line = str_replace("</td><td align=right>", "%%%", $line);
$line = eregi_replace("(<font color=)(ff3333|009900)(>)", "", $line);
$line = str_replace("<tr class=\"light\"><td>", "", $line);
list($name, $nameServer, $addrServer, $map, $player, $time) = split("%%%", $line);
$players[] = array($name, $nameServer, $addrServer, $map, $player, $time);
} // fin for(...
return $players;
}// fin findPlayers()