tranquilo/parsecsv
Composer 安装命令:
composer require tranquilo/parsecsv
包简介
A simple CSV parser, returns a multidimensional array. The class is very easy to install and use within a PSR compatiable psr compati
README 文档
README
##Parse-csv
Tranquilo Parse-csv is a miniscule PHP application library. The library allows you to pass a csv file where some validation is done to insure your data is given back within an array.
Installation
You can install this library using Composer:
$ composer require tranquilo/parsecsv This project requires PHP 5.5 and has no dependencies. The code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!
Examples
Some examples.
<?php require __DIR__ . '/vendor/autoload.php'; use Tranquilo\ParseCsv; ///use Tranquilo\Exceptions\CsvException; try{ // filepath, delimiter : optional $csv = new ParseCsv(__DIR__ . '/test.csv', ","); // optional convert the encoding $csv->convertEncoding('UTF-8'); // // starts from 5 $withOffset = $csv->getWithOffset(5); // gets all rows $allRowsCsv = $csv->get(5); // gets 10 rows starting from 5 $withLimitAndOffset = $csv->get(5, 2); print_r($allRowsCsv); unset($csv); }catch(CsvException $e){ echo $e->getMessage(); }catch(Exception $e){ echo $e->getMessage(); }
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2018-04-29