PHPackages                             ecommit/csv-table-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ecommit/csv-table-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ecommit/csv-table-generator
===========================

Create a CSV file with PHP array.

v2.0.0(3mo ago)110.7k↓50%1MITPHPPHP ^8.1CI passing

Since Aug 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/e-commit/csv-table-generator)[ Packagist](https://packagist.org/packages/ecommit/csv-table-generator)[ RSS](/packages/ecommit-csv-table-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (9)Used By (0)

CSV Table Generator
===================

[](#csv-table-generator)

Create a CSV file with PHP array.

[![Tests](https://github.com/e-commit/csv-table-generator/workflows/Tests/badge.svg)](https://github.com/e-commit/csv-table-generator/workflows/Tests/badge.svg)

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

[](#installation)

To install csv-table-generator with Composer just run :

```
$ composer require ecommit/csv-table-generator
```

Usage
-----

[](#usage)

```
use Ecommit\CsvTableGenerator\Csv;

$csv = new Csv('/home/test', 'myfilename', array(
    'header' => array(
        'Column A',
        'Column B',
    ),
));

$csv->write(array('Hello', 'world')); //Add line
$csv->write(array('Test1', 'Test2')); //Add line
$csv->close();
```

/home/test/myfilename.csv is generated :

```
"Column A","Column B"
Hello,world
Test1,Test2

```

**Constructor arguments :**

- **String $pathDir** : Path folder (when CSV file is generated) **Required**
- **String $filename** : Filename (without path folder and extension) **Required**
- **Array $options** : Options. See below

**Availabled options :**

- **header** (array) : Header array. If empty, no header. **Default: array()**
- **max\_lines** (null | int) : Max lines per CSV file. If lines &gt; max\_lines, many files are generated. **Default: null**
- **delimiter** (string) : CSV delimiter. **Default: ,**
- **enclosure** (string) : CSV enclosure. **Default: "**
- **eol** (string - Csv::EOL\_ constants) : EOF(End Of Line) character. See **Csv::EOL\_** constants. **Default: Csv::EOL\_LF**
- **escape** : CSV escape. **Default: \\**
- **add\_utf8\_bom** (bool) : Add or not UTF8 bom. **Default: false**

License
-------

[](#license)

This librairy is under the MIT license. See the complete license in *LICENSE* file.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity77

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

Recently: every ~340 days

Total

8

Last Release

91d ago

Major Versions

v1.3.0 → v2.0.02026-02-16

PHP version history (2 changes)v1.1.0PHP ^7.4|^8.0

v1.3.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/73191162d97fffaa1a23d23326a7a77fbaa94ce41e49cf4ee6cbf0b9c9800c80?d=identicon)[e-commit](/maintainers/e-commit)

---

Top Contributors

[![hlecorche](https://avatars.githubusercontent.com/u/188749?v=4)](https://github.com/hlecorche "hlecorche (72 commits)")

---

Tags

csvphparraycsvtable

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ecommit-csv-table-generator/health.svg)

```
[![Health](https://phpackages.com/badges/ecommit-csv-table-generator/health.svg)](https://phpackages.com/packages/ecommit-csv-table-generator)
```

###  Alternatives

[php-soap/ext-soap-engine

An ext-soap engine implementation

443.2M7](/packages/php-soap-ext-soap-engine)

PHPackages © 2026

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