Read in and perform operations on a file line by line : Text File Read : File Directory PHP Source Code


PHP Source Code » File Directory » Text File Read »

 

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);

?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo File Directory
» Text File Read