<?
### 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>";
?>
|