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 Nikita Pohilko  >  CSV_Parser  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Use example
Class: CSV_Parser
Parse records of data from CSV files
Author: By
Last change:
Date: 4 years ago
Size: 451 bytes
 

Contents

Class file image Download
<?

 
### Include class
 
require 'CSVParser.class.php';
 
 
### Default linebreak style is NL_WIN(\r\n), also available NL_UNIX(\n) and NL_MAC(\r)
  ### You can specify filename later, by using CSVParser->setFilename() method
 
$csv = new CSVParser("sample.csv", CSVParser::NL_WIN);
 
 
### Set delimiter symbol, default ","
 
$csv->delimiter = ",";
 
 
$data = $csv->parse();
 
  echo
"<pre>". print_r($data, true) ."</pre>";

?>