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 Rotation 2D     -  
 Line Translation 2D     -  
 DDA Line Drawing Algorithm     -  
 read from command line     -  
 start a new line in html     -  
 Line Styles in java     -  
 getting a full line input     -  
 Command Line Parser Code Using C++     -  
 java Break Line for text     -  

Topic Tags

PHP Files and I/O