PHPackages                             dcblogdev/exportcsv - 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. dcblogdev/exportcsv

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

dcblogdev/exportcsv
===================

Export array to CSV

v2.0.0(5y ago)9142MITPHPPHP &gt;=7.0.0

Since Dec 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dcblogdev/exportcsv)[ Packagist](https://packagist.org/packages/dcblogdev/exportcsv)[ GitHub Sponsors](https://github.com/dcblogdev)[ RSS](/packages/dcblogdev-exportcsv/feed)WikiDiscussions master Synced 1w ago

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/6bce1dd272d382c873d65d68e9bac7ad7cb7f7d6e4d3328912b70541bb47996a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6463626c6f676465762f6c6578706f72746373762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/lexportcsv)[![Total Downloads](https://camo.githubusercontent.com/6b461e643918dc40cebf875805be0709ea6df0c0ddbbf56891845c909ce21f3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6463626c6f676465762f6c6578706f72746373762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/lexportcsv)

[![Logo](https://repository-images.githubusercontent.com/162601250/24fed580-4856-11eb-8677-a058f79714c5)](https://repository-images.githubusercontent.com/162601250/24fed580-4856-11eb-8677-a058f79714c5)

Export arrays to CSV

Install Using composer include the repository by typing the following into a terminal

composer require dcblogdev/exportcsv

Usage
-----

[](#usage)

Include the composer autoloader, import the ExportCsv namespace.

```
use Dcblogdev\ExportCsv\ExportCsv;

//set filename
$filename = 'test.csv';

//set column names
$headerFields = ['First Name', 'Last Name', 'Company', 'Created'];

//create array
$records = [];

//loop through data and add to array
foreach($contacts as $row) {
    $records[] = [
        $row->firstName,
        $row->lastName,
        $row->companyName,
        $row->created_at
    ];
}

//OR set an array manually
$records[] = ['name', 'last name', 'comy', 'created'];

//send params to csv
new ExportCsv($records, $filename, $headerFields);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.4% 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 ~369 days

Total

3

Last Release

1968d ago

Major Versions

v1.1.0 → v2.0.02020-12-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39399156?v=4)[dcblog](/maintainers/dcblog)[@dcblog](https://github.com/dcblog)

---

Top Contributors

[![daveismynamecom](https://avatars.githubusercontent.com/u/60222583?v=4)](https://github.com/daveismynamecom "daveismynamecom (11 commits)")[![dcblogdev](https://avatars.githubusercontent.com/u/1018170?v=4)](https://github.com/dcblogdev "dcblogdev (8 commits)")[![adalenv](https://avatars.githubusercontent.com/u/7238874?v=4)](https://github.com/adalenv "adalenv (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/dcblogdev-exportcsv/health.svg)

```
[![Health](https://phpackages.com/badges/dcblogdev-exportcsv/health.svg)](https://phpackages.com/packages/dcblogdev-exportcsv)
```

###  Alternatives

[liyunfang/yii2-contextmenu

yii2 Extended for bootstrap-contextmenu plugin https://github.com/sydcanem/bootstrap-contextmenu

2432.4k1](/packages/liyunfang-yii2-contextmenu)[danielgsims/staticproxy

A thin proxy for static classes

118.2k](/packages/danielgsims-staticproxy)

PHPackages © 2026

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