PHPackages                             silverkron/php-csv-builder - 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. silverkron/php-csv-builder

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

silverkron/php-csv-builder
==========================

Build csv file and save or download it

v1.0.1(8y ago)053MITPHPPHP &gt;=5.4.0

Since Feb 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Silverkron/php-csv-builder)[ Packagist](https://packagist.org/packages/silverkron/php-csv-builder)[ RSS](/packages/silverkron-php-csv-builder/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

PHP csv builder
===============

[](#php-csv-builder)

[![GitHub last commit](https://camo.githubusercontent.com/6abaa2b22dfc9bef008693060d5df740219533bb560eb466ca9b8ebd368a024e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f53696c7665726b726f6e2f7068702d6373762d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/Silverkron/php-csv-builder)[![Latest Stable Version](https://camo.githubusercontent.com/65305603bfec5967f2ca03039428b13fb6c946e1549d20a6638090deb2bd36ba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f53696c7665726b726f6e2f7068702d6373762d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/Silverkron/php-csv-builder)[![Jarvis approved](https://camo.githubusercontent.com/04719409ac95d46533f7910fb59486ff1cf0a345a7df57873ea8d926635391b8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a61727669732d617070726f7665642d626c75652e7376673f7374796c653d666c61742d737175617265)](http://marvel-movies.wikia.com/wiki/J.A.R.V.I.S.)[![GitHub license](https://camo.githubusercontent.com/7c9ef784d0daa76726d906d7fcec53564cf7a54b57f25cfcc2088be585ed96b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f53696c7665726b726f6e2f7068702d6373762d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://github.com/Silverkron/php-csv-builder/blob/master/LICENSE)[![Twitter](https://camo.githubusercontent.com/ea8ef5118199a39e93b7363bfadacd5cf0d7ac1347969c30bc77b49041d804da/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f53696c7665726b726f6e2f7068702d6373762d6275696c6465722e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2FSilverkron%2Fphp-csv-builder)

Build csv file and save or download it. Simple librery to write csv file in your php application

Install
-------

[](#install)

Install `php-csv-builder` with Composer.

```
$ composer require silverkron/php-csv-builder

```

Initialize the class
--------------------

[](#initialize-the-class)

```
use CsvBuilder\CsvBuilder;

$csvBuilder = new CsvBuilder();
```

Available methods
-----------------

[](#available-methods)

### Change default destination path

[](#change-default-destination-path)

`setFilePath()`

```
$csvBuilder->setFilePath('/path/to/file');
```

### Change default file name

[](#change-default-file-name)

`setFileName()`

```
$csvBuilder->setFileName('/path/to/file');
```

### Set row of titles **(required)**

[](#set-row-of-titles-required)

`setTitles()`

```
$csvBuilder->setTitles([
   'Title 1',
   'Title 2',
   'Title 3',
   'Title 4'
]);
```

### Clear all rows

[](#clear-all-rows)

`clearRows()`

```
$csvBuilder->clearRows();
```

### Add new row **(required)**

[](#add-new-row-required)

`addRow()`

```
$csvBuilder->addRow([
    'Column 1',
    'Column 2',
    'Column 3',
    'Column 4',
]);
```

### Build the csv file **(required for download)**

[](#build-the-csv-file-required-for-download)

`create()`

```
$csvBuilder->create();
```

### Download csv file

[](#download-csv-file)

`download()`

```
$csvBuilder->download();
```

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3002d ago

Major Versions

0.0.1 → v1.0.02018-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/7282f6e37d0b6d756f83308f61405b653640a8ba49f4100e8f0a4be225ed719a?d=identicon)[Silverkron](/maintainers/Silverkron)

---

Top Contributors

[![Silverkron](https://avatars.githubusercontent.com/u/16318826?v=4)](https://github.com/Silverkron "Silverkron (5 commits)")

---

Tags

phpcsvbuilderwrite

### Embed Badge

![Health badge](/badges/silverkron-php-csv-builder/health.svg)

```
[![Health](https://phpackages.com/badges/silverkron-php-csv-builder/health.svg)](https://phpackages.com/packages/silverkron-php-csv-builder)
```

###  Alternatives

[openspout/openspout

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

1.1k57.6M131](/packages/openspout-openspout)[shuchkin/simplecsv

Parse and retrieve data from CSV files. Export data to CSV.

5192.4k](/packages/shuchkin-simplecsv)

PHPackages © 2026

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