PHPackages                             yantze/yii2-phpexcel - 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. yantze/yii2-phpexcel

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

yantze/yii2-phpexcel
====================

Exporting PHP to Excel

0171PHP

Since Nov 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/yantze/yii2-phpexcel)[ Packagist](https://packagist.org/packages/yantze/yii2-phpexcel)[ RSS](/packages/yantze-yii2-phpexcel/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPExcel
========

[](#phpexcel)

Feature
-------

[](#feature)

- Run Limit Time 300s
- Simple
- Flexible
- High Performance

Installation
------------

[](#installation)

The preferred way to install this extension is through composer.

Either run

```
composer require yantze/yii2-phpexcel

```

or add below line to the require section of your application's composer.json file.

```
"yantze/yii2-phpexcel" : "*"

```

Usage
-----

[](#usage)

```
$head = [
	'fhead' => [
		[
			'colspan' => 2,
			'name' => '',
		],[
			'colspan' => 2,
			'name' => 'second',
		],
	],
	'head' => [
		[
			'sort' => 'tb_col_name1',
			'name' => 'col1',
		],[
			'sort' => 'tb_col_name2',
			'name' => 'col2',
		],[
			'sort' => 'tb_col_name3',
			'name' => 'col3',
		],[
			'sort' => 'tb_col_name4',
			'name' => 'col4',
		],
	]
];

$arrayData = [
	[NULL, 2010, 2011, 2012],
	['Q1',   12,   15,   21],
	['Q2',   56,   73,   86],
	['Q3',   52,   61,   69],
	['Q4',   30,   32,    0],
];

$name = 'filename';

$excel = new \yantze\helper\Excel();
$curRow = 1;

if (count($head['fhead']) > 1 || $head['fhead'][0]['name'] != '') {
	$excel->addAdvancedMenu($head['fhead'], $curRow++);
}

$head1 = ArrayHelper::getColumn($head['head'], 'name');
$excel->addHead($head1, $curRow++);

$excel->setData($arrayData, $curRow);
$excel->output("xlsx", $name);

```

Useful PHPExcel Articles
------------------------

[](#useful-phpexcel-articles)

[PHPExcel Offical Accessing Cells](https://github.com/PHPOffice/PHPExcel/blob/develop/Documentation/markdown/Overview/07-Accessing-Cells.md)

License
-------

[](#license)

MIT

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/yantze-yii2-phpexcel/health.svg)

```
[![Health](https://phpackages.com/badges/yantze-yii2-phpexcel/health.svg)](https://phpackages.com/packages/yantze-yii2-phpexcel)
```

PHPackages © 2026

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