kothman/csv-parser

A CSV parser for PHP

1.0.1 2016-07-18 19:49 UTC

This package is not auto-updated.

Last update: 2024-04-19 20:21:19 UTC


README

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