hashemi / php-csv-export
A simple & lightweight csv export package for php
Installs: 1 470
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 1
Forks: 3
Open Issues: 0
Requires
- php: >=7.1
Requires (Dev)
- symfony/var-dumper: 5.2.x-dev
This package is auto-updated.
Last update: 2024-11-14 09:34:49 UTC
README
A simple & lightweight csv export package for PHP
Installation
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
Usage
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();
Contributing
Pull requests are welcome. For any changes, please open an issue first to discuss what you would like to change.