PHPackages                             ajur-media/xlsx-writer - 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. ajur-media/xlsx-writer

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

ajur-media/xlsx-writer
======================

PHP Library to write XLSX files

0.9.9(1y ago)046MITPHPPHP ^7.2 | ^8.0

Since Jul 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ajur-media/XLSWriter)[ Packagist](https://packagist.org/packages/ajur-media/xlsx-writer)[ RSS](/packages/ajur-media-xlsx-writer/feed)WikiDiscussions main Synced 1mo ago

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

PHP\_XLSXWriter
===============

[](#php_xlsxwriter)

This is a fork of `mk-j/php_xlsxwriter` compatible with PHP 7.2/3/4 and 8.0/1/2

Required PHP-ZIP extension, install like:

```
apt install libzip-dev php7.4-zip

```

Installation
============

[](#installation)

`composer require ajur-media/xlsx-writer`

This library is designed to be lightweight, and have minimal memory usage.

It is designed to output an Excel compatible spreadsheet in (Office 2007+) xlsx format, with just basic features supported:

- supports PHP 7.4+ and 8.0+
- takes UTF-8 encoded input
- multiple worksheets
- supports currency/date/numeric cell formatting, simple formulas
- supports basic cell styling
- supports writing huge 100K+ row spreadsheets

Simple PHP CLI example:

```
$data = [
    ['year','month','amount'],
    ['2003','1','220'],
    ['2003','2','153.5'],
];

$writer = new XLSXWriter();
$writer->writeSheet($data);
$writer->writeToFile('output.xlsx');
```

Simple/Advanced Cell Formats:

```
$header = [
  'created'=>'date',
  'product_id'=>'integer',
  'quantity'=>'#,##0',
  'amount'=>'price',
  'description'=>'string',
  'tax'=>'[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00',
];
$data = [
    ['2015-01-01',873,1,'44.00','misc','=D2*0.05'],
    ['2015-01-12',324,2,'88.00','none','=D3*0.05'],
];

$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', $header );
foreach($data as $row)
	$writer->writeSheetRow('Sheet1', $row );
$writer->writeToFile('example.xlsx');
```

50000 rows: (1.4s, 0MB memory usage)

```
$writer = new XLSXWriter();
$writer->writeSheetHeader('Sheet1', ['c1'=>'integer','c2'=>'integer','c3'=>'integer','c4'=>'integer'] );
for($i=0; $iwriteSheetRow('Sheet1', [$i, $i+1, $i+2, $i+3] );
}
$writer->writeToFile('huge.xlsx');
echo '#'.floor((memory_get_peak_usage())/1024/1024)."MB"."\n";
```

rowstimememory500001.4s0MB1000002.7s0MB1500004.1s0MB2000005.7s0MB2500007.0s0MBSimple cell formats map to more advanced cell formats

simple formatsformat codestring@integer0dateYYYY-MM-DDdatetimeYYYY-MM-DD HH:MM:SStimeHH:MM:SSprice\#,##0.00dollar\[$$-1009\]#,##0.00;\[RED\]-\[$$-1009\]#,##0.00euro\#,##0.00 \[$€-407\];\[RED\]-#,##0.00 \[$€-407\]Basic cell styles:

styleallowed valuesfontArial, Times New Roman, Courier New, Comic Sans MSfont-size8,9,10,11,12 ...font-stylebold, italic, underline, strikethrough or multiple ie: 'bold,italic'borderleft, right, top, bottom, or multiple ie: 'top,left'border-stylethin, medium, thick, dashDot, dashDotDot, dashed, dotted, double, hair, mediumDashDot, mediumDashDotDot, mediumDashed, slantDashDotborder-color\#RRGGBB, ie: #ff99cc or #f9ccolor\#RRGGBB, ie: #ff99cc or #f9cfill\#RRGGBB, ie: #eeffee or #efehaligngeneral, left, right, justify, centervalignbottom, center, distributed

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

679d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2164874?v=4)[Karel Wintersky](/maintainers/KarelWintersky)[@KarelWintersky](https://github.com/KarelWintersky)

---

Tags

phplibraryexcelxlsxlsx

###  Code Quality

TestsPHPUnit

Static AnalysisRector

### Embed Badge

![Health badge](/badges/ajur-media-xlsx-writer/health.svg)

```
[![Health](https://phpackages.com/badges/ajur-media-xlsx-writer/health.svg)](https://phpackages.com/packages/ajur-media-xlsx-writer)
```

###  Alternatives

[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k8.1M27](/packages/mk-j-php-xlsxwriter)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

2951.2M7](/packages/avadim-fast-excel-writer)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet Reader in PHP

104608.4k6](/packages/avadim-fast-excel-reader)[avadim/fast-excel-templator

Lightweight and very fast Excel Spreadsheet generator from XLSX-templates in PHP

20106.6k](/packages/avadim-fast-excel-templator)[maksimovic/php-xlsx-writer

PHP Library to write XLSX files

1143.0k](/packages/maksimovic-php-xlsx-writer)

PHPackages © 2026

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