Read in and perform operations on a file line by line
<?
$fd = fopen("test.txt", "r");
while(!feof($fd)) {
$line = fgets($fd, 4096);
if(strcmp($line,$targetline) == 0) {
echo "A match was found!";
}
}
fclose($fd);
?>
Related examples in the same category