PHPackages                             hesunfly/php-excel-more-sheet - 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. hesunfly/php-excel-more-sheet

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

hesunfly/php-excel-more-sheet
=============================

php excel 导入导出, 由于需要在swoole中使用，所以重新构建了该扩展包，原地址：https://github.com/jianyan74/php-excel

01PHP

Since Dec 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hesunfly/php-excel-more-sheet)[ Packagist](https://packagist.org/packages/hesunfly/php-excel-more-sheet)[ RSS](/packages/hesunfly-php-excel-more-sheet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

php-excel-more-sheet
====================

[](#php-excel-more-sheet)

php excel 导入导出, 由于需要在 swoole 中使用，所以重新构建了该扩展包，主要去除了影响 swoole 运行的 exit() 和 die()，原地址：, 该版本支持多sheet导出，可以看下 demo 代码。

安装
--

[](#安装)

```
composer require hesunfly/php-excel-more-sheet

```

引入

```
use Hesunfly\ExcelMoreSheet;

```

Demo
----

[](#demo)

```
$arr = [
    [
        'title' => '第一个sheet',
        'header' => [
            ['姓名', 'a'],
            ['年龄', 'b'],
        ],
        'list' => [
            [
                'a' => '张三',
                'b' => '18',
            ],
            [
                'a' => '李四',
                'b' => '22',
            ],
        ],
    ],
    [
        'title' => '第二个sheet',
        'header' => [
            ['姓名1', 'a'],
            ['年龄2', 'b'],
        ],
        'list' => [
            [
                'a' => '王五',
                'b' => '18',
            ],
            [
                'a' => '赵六',
                'b' => '22',
            ],
        ],
    ]
];

$file_name = '导出数据-' . time() . '.xlsx';
$base_path = __DIR__ . '/public/';
$file_dir = 'file/export/' . date('Y');
if (!file_exists($base_path . $file_dir)) {
    mkdir($base_path . $file_dir, 0777, true);
}
$access_path = $file_dir . '/' . $file_name;

\Hesunfly\ExcelMoreSheet\ExcelMoreSheet::exportData($arr, $file_name, 'xlsx', $base_path . $access_path);
```

```
// [名称, 字段名, 类型, 类型规则]
$header = [
    ['ID', 'id', 'text'],
    ['手机号码', 'mobile'], // 规则不填默认text
    ['openid', 'fans.openid', 'text'],
    ['昵称', 'fans.nickname', 'text'],
    ['关注/扫描', 'type', 'selectd', [1 => '关注', 2 => '扫描']],
    ['性别', 'sex', 'function', function($model){
        return $model['sex'] == 1 ? '男' : '女';
    }],
    ['创建时间', 'created_at', 'date', 'Y-m-d'],
    ['图片', 'image', 'text'],// 本地图片 ./images/765456898612.jpg
];

```

```

### 导入

```

/\*\*

- 导入
-
- @param $filePath excel的服务器存放地址 可以取临时地址
- @param int $startRow 开始和行数 默认1
- @param bool $hasImg 导出的时候是否有图片
- @param string $suffix 格式
- @param string $imageFilePath 作为临时使用的 图片存放的地址
- @return array|bool|mixed \*/ $data = Excel::import($filePath, $startRow = 1,$hasImg = false,$suffix = 'Xlsx',$imageFilePath = null);

```

```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

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://www.gravatar.com/avatar/0f2634d7ceda148b891d5903bf356c24c30bc86ea6691f3f6806b323a5e8836e?d=identicon)[Hesunfly](/maintainers/Hesunfly)

### Embed Badge

![Health badge](/badges/hesunfly-php-excel-more-sheet/health.svg)

```
[![Health](https://phpackages.com/badges/hesunfly-php-excel-more-sheet/health.svg)](https://phpackages.com/packages/hesunfly-php-excel-more-sheet)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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