kothman/csv-parser

PHP 的 CSV 解析器

1.0.1 2016-07-18 19:49 UTC

This package is not auto-updated.

Last update: 2024-09-20 22:12:56 UTC


README

Build Status Latest Stable Version Total Downloads

PHP 的 CSV 解析器。

安装

通过 Composer

$ composer require kothman/csv-parser

用法

$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();

测试

$ composer test