Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 130 | All time: 9,364 This week: 206![]() |
Version | License | PHP version | Categories | |||
php-csv-export 1.0 | Custom (specified... | 5 | PHP 5, Files and Folders |
Description | Author | |
This package can export array data to a CVS file to be downloaded. |
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.
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Hashemi\CsvExport\CsvExport;
$headers = [
'id',
'name',
'age'
];
$rows = [
[1, 'Foo', 12],
[2, 'Bar', 34],
[3, 'John', 12]
];
(new CsvExport())
->setHeaders($headers)
->setRows($rows)
->setFileName('employee.csv')
->download();
// 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.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Read me |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.