Opening and Reading a File Line by Line : File Read : File Directory PHP Source Code


PHP Source Code » File Directory » File Read »

 

Opening and Reading a File Line by Line



<html>
<head>
<title>Opening and reading a file line by line</title>
</head>
<body>
<?php
$filename = "test.txt";
$fp = fopen$filename, "r" or die("Couldn't open $filename");
while ! feof$fp ) ) {
   $line = fgets$fp, 1024 );
   print "$line<br>";
}
?>
</body>
</html>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo File Directory
» File Read