PHP Classes

PHP CSV Export Download: Export array data to a CVS file to be downloaded

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 127 All time: 9,329 This week: 190Up
Version License PHP version Categories
php-csv-export 1.0Custom (specified...5PHP 5, Files and Folders


This package can export array data to a CVS file to be downloaded.

It can take an array of data to be exported and generates a CSV file that is served for download as a file with a given name.

The CSV file name and the CSV column header names are configurable parameters.

Picture of Hashemi Rafsan
  Performance   Level  
Name: Hashemi Rafsan <contact>
Classes: 6 packages by
Country: Bangladesh Bangladesh
Age: 27
All time rank: 404746 in Bangladesh Bangladesh
Week rank: 703 Up16 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 1x


PHP CSV Export

A simple & lightweight csv export package for PHP


You can start it from composer. Go to your terminal and run this command from your project root directory.

composer require hashemi/php-csv-export


After Complete installation, It's time to check how to use.


require_once __DIR__ . '/vendor/autoload.php';

use Hashemi\CsvExport\CsvExport;

$headers = [

$rows = [
    [1, 'Foo', 12],
    [2, 'Bar', 34],
    [3, 'John', 12]

(new CsvExport())

// or

(new CsvExport($headers, $rows, 'employee.csv'))->download();


Pull requests are welcome. For any changes, please open an issue first to discuss what you would like to change.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Read me

  Files folder image Files  /  src  
File Role Description
  Plain text file CsvExport.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,329
This week:190Up