kentreez/easy-file-reader
Composer 安装命令:
composer require kentreez/easy-file-reader
包简介
Simple way for reading .txt, .msv, .xls, .xlsx
README 文档
README
Reading each lines data from file (.txt, .csv, .xls, .xlsx). The library using PHP Generator then input file will be read line by line to avoid store total file data in memory.
*** Caution ***
Because of using Generator for iterate over input file's rows. DO NOT BREAK the loop while iterate over file's rows it will cause unexpected behavior.
Usage:
<?php
use Kentreez\EasyFileReader\EasyFileReader;
require_once 'vendor/autoload.php';
$easy = EasyFileReader::Read('example.xlsx');
// count all rows
$easy->count();
// iterate over rows in input file
foreach ($easy->rows() as $rows) {
print_r($rows);
}
// if we interest only first column of each row then
foreach ($easy->firstColumns() as $str) {
echo $str . PHP_EOL;
}
?>
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-28