<? $fd = fopen("test.txt", "r"); while(!feof($fd)) { $line = fgets($fd, 4096); if(strcmp($line,$targetline) == 0) { echo "A match was found!"; } } fclose($fd); ?>