Tags

,

PHP CSV Reader

by dom111 on October 7th, 2009

I’ve never really built a definitive CSV reader and end up building a quick implementation of one any time I need one.

But after working on the chunk script I decided that next time I build a CSV class I’d do it properly.

This is the result:

  <?php
  require('class.csv.php');
 
  header('Content-type: text/plain');
 
  $csv = new CSV('test.csv');
 
  while ($row = $csv->read()) {
    print_r($row);
  }

There’s an information page here, and the script is here.

From Coding, PHP

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS