bluefrg/parsecsv
最新稳定版本:2.0.0
Composer 安装命令:
composer require bluefrg/parsecsv
包简介
Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows.
README 文档
README
Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows.
There are other libraries which accomplish the similar thing, but they are memory inefficient and rely on their own (sometimes buggy) parsing implementation.
<?php $oCsv = new ParseCsv('users.csv'); $oCsv->firstRowHeader(); foreach($oCsv as $aRow) { print_r($aRow); }
Given the example users.csv file:
id,firstName
11,Billy
The resulting output will be:
Array
(
[id] => 11
[firstName] => Billy
)
Install
$ composer require bluefrg/parsecsv:dev-master
统计信息
- 总下载量: 7.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-02