PHP CSV Reader

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.