PHPackages                             diego3/php-export-data - 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. diego3/php-export-data

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

diego3/php-export-data
======================

A simple library for exporting tabular data to Excel-friendly XML, CSV, or TSV

v1.0.0(10y ago)36.1k3MITPHPPHP &gt;=5.3.0

Since Sep 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/diego3/php-export-data)[ Packagist](https://packagist.org/packages/diego3/php-export-data)[ Docs](http://github.com/diego3/php-export-data)[ RSS](/packages/diego3-php-export-data/feed)WikiDiscussions master Synced yesterday

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

php-export-data by Eli Dickinson

Released under the permissive MIT License:

A simple library for exporting tabular data to Excel-friendly XML, CSV, or TSV. It supports streaming exported data to a file or directly to the browser as a download so it is suitable for exporting large datasets (you won't run out of memory).

Excel XML code is based on Excel\_XML by Oliver Schwarz ()

Composer Install
----------------

[](#composer-install)

```
composer require diego3/php-export-data
```

How to use it
-------------

[](#how-to-use-it)

```
// When executed in a browser, this script will prompt for download
// of 'test.xls' which can then be opened by Excel or OpenOffice.

use Export\ExportDataExcel;

// 'browser' tells the library to stream the data directly to the browser.
// other options are 'file' or 'string'
// 'test.xls' is the filename that the browser will use when attempting to
// save the download
$exporter = new ExportDataExcel('browser', 'test.xls');

$exporter->initialize(); // starts streaming data to web browser

// pass addRow() an array and it converts it to Excel XML format and sends
// it to the browser
$exporter->addRow(array("This", "is", "a", "test"));
$exporter->addRow(array(1, 2, 3, "123-456-7890"));

// doesn't care how many columns you give it
$exporter->addRow(array("foo"));

$exporter->finalize(); // writes the footer, flushes remaining data to browser.
exit(); // all done
```

See the test/ directory for more examples.

Some other options for creating Excel files from PHP are listed here:

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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

Unknown

Total

1

Last Release

3929d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36f600456766fc26b21094e8102db8a4bf05092b7467b62b689cd5adb01a4e1c?d=identicon)[diego3](/maintainers/diego3)

---

Top Contributors

[![elidickinson](https://avatars.githubusercontent.com/u/44751?v=4)](https://github.com/elidickinson "elidickinson (20 commits)")[![diego3](https://avatars.githubusercontent.com/u/7679729?v=4)](https://github.com/diego3 "diego3 (13 commits)")[![NemoD503](https://avatars.githubusercontent.com/u/4633952?v=4)](https://github.com/NemoD503 "NemoD503 (1 commits)")

---

Tags

libraryexcelcsv

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/diego3-php-export-data/health.svg)

```
[![Health](https://phpackages.com/badges/diego3-php-export-data/health.svg)](https://phpackages.com/packages/diego3-php-export-data)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.9k157.3M890](/packages/maatwebsite-excel)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k27.0M52](/packages/rap2hpoutre-fast-excel)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k70.2M240](/packages/openspout-openspout)[mk-j/php_xlsxwriter

PHP Library to write XLSX files

1.9k8.7M31](/packages/mk-j-php-xlsxwriter)[gotenberg/gotenberg-php

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

3856.2M31](/packages/gotenberg-gotenberg-php)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP

107737.8k11](/packages/avadim-fast-excel-reader)

PHPackages © 2026

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