PHPackages                             cck/php-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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. cck/php-excel

ActiveExtension[PDF &amp; Document Generation](/categories/documents)

cck/php-excel
=============

php excel 导入导出

v1.0.6(4y ago)029MITPHPPHP &gt;=7.0

Since Apr 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/liuzhengjian/php-excel)[ Packagist](https://packagist.org/packages/cck/php-excel)[ RSS](/packages/cck-php-excel/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

php-excel
=========

[](#php-excel)

安装
--

[](#安装)

```
composer require cck/php-excel

```

引入

```
use cck\excel\Excel;

```

Demo
----

[](#demo)

```
// [名称, 字段名, 类型, 类型规则]
$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'],
];

$list = [
    [
        'id' => 1,
        'type' => 1,
        'mobile' => '18888888888',
        'fans' => [
            'openid' => '123',
            'nickname' => '昵称',
        ],
        'sex' => 1,
        'create_at' => time(),
    ]
];

```

### 导出

[](#导出)

```
// 简单使用
return Excel::exportData($list, $header);

// 定制 默认导出xlsx 支持 : xlsx/xls/html/csv， 支持写入绝对路径
return Excel::exportData($list, $header, '测试', 'xlsx', '/www/data/');

// 另外一种导出csv方式
return Excel::exportCsvData($list, $header);

```

### 导入

[](#导入)

```
/**
 * 导入
 *
 * @param $filePath 文件路径
 * @param int $startRow 开始行数 默认 1
 * @return array|bool|mixed
 */
$data = Excel::import($filePath, $startRow);

```

### FORK

[](#fork)

[jianyan74/php-excel](https://github.com/jianyan74/php-excel)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~132 days

Recently: every ~163 days

Total

6

Last Release

1545d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e05956a0a365db4e89278e9def8bee66915084842a417e5bee890d362ebcd902?d=identicon)[liuzhengjian](/maintainers/liuzhengjian)

---

Top Contributors

[![liuzhengjian](https://avatars.githubusercontent.com/u/4033714?v=4)](https://github.com/liuzhengjian "liuzhengjian (6 commits)")

---

Tags

htmlexcelxlsxlsxcsvcck

### Embed Badge

![Health badge](/badges/cck-php-excel/health.svg)

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

###  Alternatives

[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1623.1M35](/packages/kartik-v-yii2-export)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

669863.2k8](/packages/nuovo-spreadsheet-reader)[jianyan74/php-excel

php excel 导入导出

5842.2k4](/packages/jianyan74-php-excel)[jgrygierek/batch-entity-import-bundle

Importing entities with preview and edit features for Symfony.

101.1M1](/packages/jgrygierek-batch-entity-import-bundle)

PHPackages © 2026

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