Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Hamid Ghorashi  >  Read Text Files  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Read Text Files
Read text files line by line
Author: By
Last change: the required file was updated.
Date: 2 years ago
Size: 308 bytes
 

Contents

Class file image Download
<?php

require("textfilereader.class.php");

$filename "testfile.txt";
$sf = new TextFileReader($filename);
        
$sf->seekLine(1);   // Go to line 1
    
while (($val $sf->readLine())!=NULL)
            echo 
$val."<br/>";
         
        echo 
"Total number of lines: ".$sf->countLines();
?>