PHPackages                             slam/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. slam/php-excel

Abandoned → [slam/openspout-helper](/?search=slam%2Fopenspout-helper)ArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

slam/php-excel
==============

Old faster PHPExcel

v5.1.0(4y ago)2539.4k↓79.2%2MITPHPPHP &gt;=8.0

Since Apr 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Slamdunk/php-excel)[ Packagist](https://packagist.org/packages/slam/php-excel)[ Fund](https://paypal.me/filippotessarotto)[ GitHub Sponsors](https://github.com/Slamdunk)[ RSS](/packages/slam-php-excel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (9)Versions (23)Used By (0)

ABANDONED, use [`slam/openspout-helper`](https://packagist.org/packages/slam/openspout-helper)
==============================================================================================

[](#abandoned-use-slamopenspout-helper)

Slam PHPExcel old&amp;faster
============================

[](#slam-phpexcel-oldfaster)

[![Latest Stable Version](https://camo.githubusercontent.com/d93d04dd000a8cb5c766be13cacb3e0044b96697f054ca0828e0c4d0fb4e0fe3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f7068702d657863656c2e737667)](https://packagist.org/packages/slam/php-excel)[![Downloads](https://camo.githubusercontent.com/08bc79fc7d9eeb46e6fe73ba0f777b1bc1ce24b8aa7f3948d7f9b568e90d2f8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f7068702d657863656c2e737667)](https://packagist.org/packages/slam/php-excel)[![Integrate](https://github.com/Slamdunk/php-excel/workflows/Integrate/badge.svg?branch=master)](https://github.com/Slamdunk/php-excel/actions)[![Code Coverage](https://camo.githubusercontent.com/6c14d3807d7de2cc0e26ad679dc75ddd516f026d75dcb7c74ba128a15ac75b81/68747470733a2f2f636f6465636f762e696f2f67682f536c616d64756e6b2f7068702d657863656c2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/gh/Slamdunk/php-excel?branch=master)

This package is *NOT* intended to be complete and flexible, but to be *fast*.

[PHPOffice/PHPExcel](https://github.com/PHPOffice/PHPExcel) and [PHPOffice/PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) are great libraries, but abstract everything in memory before writing to the disk. This is extremely inefficent and slow if you need to write a giant XLS with thousands rows and hundreds columns.

Based on [Spreadsheet\_Excel\_Writer v0.9.3](http://pear.php.net/package/Spreadsheet_Excel_Writer), which can be found active on [Github](https://github.com/pear/Spreadsheet_Excel_Writer). This is not a fork: I copied it and adapted to work with PHP 7.1 and applied some coding standard fixes and some Scrutinizer patches.

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

[](#installation)

`composer require slam/php-excel`

Usage
-----

[](#usage)

From version 4 the code is split in two parts:

1. `Slam\Excel\Pear` namespace, the original Pear code
2. `Slam\Excel\Helper` namespace, an helper to apply a trivial style on a Table structure:

```
use Slam\Excel\Helper as ExcelHelper;

require __DIR__ . '/vendor/autoload.php';

// Being an Iterator, the data can be any dinamically generated content
// for example a PDOStatement set on unbuffered query
$users = new ArrayIterator([
    [
        'column_1' => 'John',
        'column_2' => '123.45',
        'column_3' => '2017-05-08',
    ],
    [
        'column_1' => 'Mary',
        'column_2' => '4321.09',
        'column_3' => '2018-05-08',
    ],
]);

$columnCollection = new ExcelHelper\ColumnCollection([
    new ExcelHelper\Column('column_1',  'User',     10,     new ExcelHelper\CellStyle\Text()),
    new ExcelHelper\Column('column_2',  'Amount',   15,     new ExcelHelper\CellStyle\Amount()),
    new ExcelHelper\Column('column_3',  'Date',     15,     new ExcelHelper\CellStyle\Date()),
]);

$filename = sprintf('%s/my_excel_%s.xls', __DIR__, uniqid());

$phpExcel = new ExcelHelper\TableWorkbook($filename);
$worksheet = $phpExcel->addWorksheet('My Users');

$table = new ExcelHelper\Table($worksheet, 0, 0, 'My Heading', $users);
$table->setColumnCollection($columnCollection);

$phpExcel->writeTable($table);
$phpExcel->close();
```

Result:

[![Example](https://raw.githubusercontent.com/Slamdunk/php-excel/master/example.png)](https://raw.githubusercontent.com/Slamdunk/php-excel/master/example.png)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity78

Established project with proven stability

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

Recently: every ~360 days

Total

22

Last Release

1656d ago

Major Versions

v1.2.1 → v2.0.02016-07-01

v2.1.0 → v3.0.02017-01-17

v3.0.0 → v4.0.02017-05-09

v4.5.0 → v5.0.02021-08-03

PHP version history (4 changes)v3.0.0PHP ^7.0

v4.3.0PHP ^7.1

v4.5.0PHP ^7.4 || ^8.0

v5.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50348?v=4)[Sahn Lam](/maintainers/Slam)[@slam](https://github.com/slam)

---

Top Contributors

[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (108 commits)")

---

Tags

excelphpexcel

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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