kothman/csv-parser

A CSV parser for PHP


License
MIT

Documentation

CSVParser

Build Status Latest Stable Version Total Downloads

A CSV Parser for PHP.

Install

Via Composer

$ composer require kothman/csv-parser

Usage

$parser = new Kothman\CSVParser("file.csv");
while($row = $parser->row()) {
    echo implode(", ", $row);
}

$parser->rewind();
$parser->row();

$anotherParser = new Kothman\CSVParser("https://some.csv.file.csv", $delimeter = '.');
echo $anotherParser->toDictionary();
echo $anotherParser->countColumns();
echo $anotherParser->countRows();

Testing

$ composer test