lol @ swr, this won't end that way because I'm using one of my site's, I'm just trying to find info about game servers, the info is on another page though, and I don't wanna go through that page(open source program) and find out how it gets the info, so I'm doing it this way.
anyways,
<?php
$site = file("PAGE_TO_BE_LOADED");
$text = implode("", $site);
$ser1 = ereg("chief</a></td>\n<td>Online</td>", $text);
$ser2 = ereg("iceman</a></td>\n<td>Online</td>", $text);
$ser3 = ereg("Squad CSi</a></td>\n<td>Online</td>", $text);
if($ser1 == TRUE) {
$server1 = "1";
}
if($ser2 == TRUE) {
$server2 = "1";
}
if($ser3 == TRUE) {
$server3 = "1";
}
$serversnum = $server1 + $server2 + $server3;
echo $serversnum;
If there is a more efficient way to do this I would be very thankful, especially if you could make it to where the servers(chief, iceman, Squad CSi) don't have to be listed in this code, so I wouldn't have to update it every time we add a server.