Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Reading a File Line by Line in php

Sun Oct 26, 2008 9:20 pm

Code:

<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$fp1024 );
   print 
"$line<br>";
}
?>
</body>
</html>




Post a reply
  Related Posts  to : Reading a File Line by Line in php
 the text file i saved all in one line. How can i solve it?     -  
 Line Translation 2D     -  
 Line Rotation 2D     -  
 getting a full line input     -  
 DDA Line Drawing Algorithm     -  
 read from command line     -  
 start a new line in html     -  
 Line Styles in java     -  
 c program - command line prompt - need help     -  
 Command Line Parser Code Using C++     -  

Topic Tags

PHP Files and I/O