PHP Classes


Recommend this page to a friend!
  Classes of Hashemi Rafsan   PHP CSV Export Download   Download  
Role: Documentation
Content type: text/markdown
Description: Read me
Class: PHP CSV Export Download
Export array data to a CVS file to be downloaded
Author: By
Last change:
Date: 2 years ago
Size: 854 bytes


Class file image Download

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.