PHPackages                             eric-strive/big-excel-upload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. eric-strive/big-excel-upload

ActiveLibrary

eric-strive/big-excel-upload
============================

This is a test package,form author is eric.

23PHP

Since Sep 5Pushed 6y agoCompare

[ Source](https://github.com/eric-strive/big-excel-upload)[ Packagist](https://packagist.org/packages/eric-strive/big-excel-upload)[ RSS](/packages/eric-strive-big-excel-upload/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

大文件数据分割读取
=========

[](#大文件数据分割读取)

- PHP 5.6+

```
php composer.phar require --prefer-dist eric-strive/big-excel-upload "*"
```

大文件数据分割读取
---------

[](#大文件数据分割读取-1)

$excelCutModel = new \\excelUpload\\ExcelCutRead($localFilePath, \[ 'startRow' =&gt; '',//文件数据开始行 'averageNum' =&gt; 5000,//分割每页需要的数据 'invertedSubtract' =&gt; '',//尾部不需要数据的行数 'isReverse' =&gt; '',//文件数据读取是否倒序 \]); //分批获取以及处理需要的数据 $excelCutModel-&gt;cutFromFile(function ($excelData) { //处理$excelData });

将大文件分割成小文件
----------

[](#将大文件分割成小文件)

$file = '/tmp/a.xlsx'; $datas = \[ '工作表\_1' =&gt; \[ \[1, 'a'\], \[2, 'b'\], \[3, 'c'\], \[4, 'd'\], \], '工作表\_2' =&gt; \[ \[10, 'ab'\], \[20, 'bc'\], \[30, 'cd'\], \], \]; $spreadsheet = new \\PhpOffice\\PhpSpreadsheet\\Spreadsheet(); $i = 0; foreach ($datas as $sheetName =&gt; $sheetData) { if ($i &gt; 0) { $spreadsheet-&gt;createSheet(); $spreadsheet-&gt;setActiveSheetIndex($i); } $spreadsheet-&gt;getActiveSheet()-&gt;setTitle($sheetName); foreach ($sheetData as $rowIndex =&gt; $row) { foreach ($row as $colIndex =&gt; $col) { $spreadsheet-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow($colIndex + 1, $rowIndex + 1, $col); } } $i++; } $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($spreadsheet, 'Xlsx'); $writer-&gt;save($file);

$excel = new \\excelUpload\\ExcelCutWrite(); $excel-&gt;cutNum = 4; $excel-&gt;returnType = 'Csv'; $result = $excel-&gt;cutFromFile($file);

$this-&gt;assertEquals(basename($result\[0\]), 'a\_工作表\_1\_0.Csv'); $this-&gt;assertEquals(basename($result\[1\]), 'a\_工作表\_1\_1.Csv'); $this-&gt;assertEquals(basename($result\[2\]), 'a\_工作表\_2\_0.Csv'); $this-&gt;assertEquals(basename($result\[3\]), 'a\_工作表\_2\_1.Csv');

$this-&gt;assertEquals(preg\_split("/(\\s|,)+/", file\_get\_contents($result\[0\])), \['"1"', '"a"', '"2"', '"b"', ''\]); $this-&gt;assertEquals(preg\_split("/(\\s|,)+/", file\_get\_contents($result\[1\])), \['"3"', '"c"', '"4"', '"d"', ""\]); $this-&gt;assertEquals(preg\_split("/(\\s|,)+/", file\_get\_contents($result\[2\])), \['"10"', '"ab"', '"20"', '"bc"', ""\]); $this-&gt;assertEquals(preg\_split("/(\\s|,)+/", file\_get\_contents($result\[3\])), \['"30"', '"cd"', ""\]); unlink($file);

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/578876?v=4)[wangwei](/maintainers/wangwei)[@wangwei](https://github.com/wangwei)

---

Top Contributors

[![eric-strive](https://avatars.githubusercontent.com/u/22976965?v=4)](https://github.com/eric-strive "eric-strive (6 commits)")

### Embed Badge

![Health badge](/badges/eric-strive-big-excel-upload/health.svg)

```
[![Health](https://phpackages.com/badges/eric-strive-big-excel-upload/health.svg)](https://phpackages.com/packages/eric-strive-big-excel-upload)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
