承接 kentreez/easy-file-reader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-28