PHPackages                             jindai/easy-excel - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. jindai/easy-excel

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jindai/easy-excel
=================

Simple operation excel package based on phpExcel

v1.1(7y ago)07MITPHPPHP &gt;=7.0.0

Since Sep 17Pushed 7y agoCompare

[ Source](https://github.com/jindai0305/easyExcel)[ Packagist](https://packagist.org/packages/jindai/easy-excel)[ RSS](/packages/jindai-easy-excel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Description
===========

[](#description)

A simple excel Package of PHP

install
=======

[](#install)

composer require jindai/easy-excel

Usage
=====

[](#usage)

1. 读取excel

```
$easyExcel = new \JinDai\EasyExcel\EasyExcel();

$fileName = __DIR__ . "/read.xlsx";

class ABC
{
    public function substr($string)
    {
        return substr($string, -3);
    }
}

$readColumn = [
    ['A', 'order_id', 'strtolower'],
    ['B', 'user_name', 'strtoupper'],
    ['C', 'account', function ($item) {
        return 'hello i\'m 匿名函数' . $item . '这这这这这';
    }],
    ['D', 'phone', [new ABC(), 'substr']],
    ['E', 'time', [new \JinDai\EasyExcel\ExcelFormat(), 'time']]
];
//你可以在readColumn中传入自定义匿名函数或者任何一个在当前页面可以访问到的函数来处理当前列并获取处理后的值
//当然你也可以置空这个选项 只要不传入该值即可
//例如
//$readColumn = ['A','B','C'] OR $readColumn = [['A','order_id'],['B','user_name']]

try {
    //提供三种方法来获取读取的结果
    //toForeach 返回的是Generator对象 可以极小化使用内存
    //toArray 返回的是读取后返回的所有内容
    //toJson 返回的是toArray的json串
    $data = $easyExcel->read($fileName)->setReadRow(2, 150)->setReadColumn($readColumn)->setChunkNumber(150)->toForeach();

} catch (\JinDai\EasyExcel\Exceptions\RuntimeException $e) {
    die($e->getMessage());
}

foreach ($data as $value) {
    var_dump($value);
}
```

2. 导出excel

```
$easyExcel = new \JinDai\EasyExcel\EasyExcel();

$fileName = "C:/wamp64/www/easyExcel/tests/write.xlsx";

class ABC
{
    public function substr($string)
    {
        return substr($string, -3);
    }
}

$title = [
    'A' => ['order_id', '订单id', 'strtolower'],
    'B' => ['name', '昵称', 'strtoupper'],
    'C' => ['account', '账号', function ($item) {
        return 'hello i\'m 匿名函数' . $item . '这这这这这';
    }],
    'D' => ['phone', '手机号', [new ABC(), 'substr']],
    'E' => ['date', '生成日期', [new \JinDai\EasyExcel\ExcelFormat(), 'time']]
];

$data = [
    [
        'order_id' => 'R45614650',
        'name' => 'jindai',
        'account' => 'cc520820lk@163.com',
        'phone' => '15068548568',
        'date' => Date('Y-m-d')
    ]
];

for ($i = 1; $i < 10000; $i++) {
    array_push($data, [
        'order_id' => 'R4561465' . $i,
        'name' => 'jindai' . $i,
        'account' => 'cc520820lk@163.com' . $i,
        'phone' => '1506854856' . $i,
        'date' => Date('Y-m-d')
    ]);
}

try {
    $data = $easyExcel->write($fileName)->setTitle($title)->setData($data)->download();
} catch (\JinDai\EasyExcel\Exceptions\RuntimeException $e) {
    die($e->getMessage());
}
```

License
=======

[](#license)

The Easy - Excel is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~34 days

Total

2

Last Release

2762d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7032650e93f38c93daf2867dadc4de75633930b1c44dcba588f8c5fd0f0eddce?d=identicon)[jindai](/maintainers/jindai)

---

Top Contributors

[![jindai0305](https://avatars.githubusercontent.com/u/24999354?v=4)](https://github.com/jindai0305 "jindai0305 (8 commits)")

### Embed Badge

![Health badge](/badges/jindai-easy-excel/health.svg)

```
[![Health](https://phpackages.com/badges/jindai-easy-excel/health.svg)](https://phpackages.com/packages/jindai-easy-excel)
```

PHPackages © 2026

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