locr-company/csv-reader
最新稳定版本:1.0.3
Composer 安装命令:
composer require locr-company/csv-reader
包简介
A class for reading csv-files.
README 文档
README
1. Installation
composer require locr-company/csv-reader
2. How to use
Here are the Docs.
<?php use Locr\Lib\CsvReader; $csvReader = new CsvReader(); $csvReader->loadFile('file.csv'); $csvReader->setFirstLineIsHeader(true); // if the first line of the csv-file has column informations // read all rows at once $rows = $csvReader->readDataset(); foreach ($rows as $row) { print $row['column1'] . '|' . $row['column2'] . "\n"; } // read rows one by one, if you expect a very large csv-file $csvReader->readDatasetsCallback(function (array $row, int $lineNumber) { print $row['column1'] . '|' . $row['column2'] . "\n"; });
3. Development
Clone the repository
git clone git@github.com:locr-company/php-csv-reader.git cd php-csv-reader && composer install
统计信息
- 总下载量: 1.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-15