File: example.php

Recommend this page to a friend!
  Classes of Richard Munroe  >  Delimited Text Files  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of use of DelmitedTextFiles
Class: Delimited Text Files
Parse comma or tab delimited text lines
Author: By
Last change:
Date: 13 years ago
Size: 454 bytes


Class file image Download

 * You'll need the dm.File class from to run this example.
 * The test file is a sanitized log file from paypal.

include_once('File/class.File.php') ;
'class.DelimitedTextFiles.php') ;

    while ((
$line = $theFile->gets()) !== FALSE)
var_dump(DelimitedTextFiles::parse($line, "\t")) ;
"\n" ;

$a = new File('Download.txt', 'r', 'parse') ;

For more information send a message to info at phpclasses dot org.