// suck the remote file into a string $remote_site = join('', file("http://remote.domain.com/index.php") ); preg_match_all( "|<tr>(.*)<a name=\"(.*)\">(.*):</a>(.*)<IMG SRC=\"(.*)\"(.*)</tr>|Ui", $remote_site,$matches); for ($i=0; $i<count($matches[3]); $i++) { $name = $matches[3]; $image = $matches[5]; if (strstr($image,'grnball.gif')) { // green ball } else { // red ball } // do your thingy }