Download the PHP package sujan/php-csv-exporter without Composer
On this page you can find all versions of the php package sujan/php-csv-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sujan/php-csv-exporter
More information about sujan/php-csv-exporter
Files in sujan/php-csv-exporter
Package php-csv-exporter
Short Description A PHP library to export data to CSV
License MIT
Informations about the package php-csv-exporter
Overview
A fast and tiny PHP library to export data to CSV. The library is based on a PHP generator.
Why Use
It took me 5 seconds to export 5M data so you can call it fast enough. And because of the use of Generator it uses less memory and never get caught by memory exception.
Installation
Basic Usage
Build and export, that much simple.
Documentation
- Build CSV
- Export CSV
- Usage Examples
- Laravel
- From Eloquent Query Builder (RECOMMENDED)
- From Collection
- From Array
- Eloquent Relation
- RAW PHP
- From Array
- From PDOStatement (RECOMMENDED)
- Laravel
Build CSV
CSV build takes three parameters. First one is the model which could be Array
, PDOStatement
, Eloquent Query Builder
and
Collection
, seconds one takes the field names you want to export, third one is CSV filename.
Export CSV
Usage Examples
Laravel
You can export data from Eloquent Query Builder
, Collection
and Array
whereas Eloquent Query Builder
is highly recommended.
From Eloquent Query Builder (RECOMMENDED)
From Collection
From Array
Eloquent Relation
Raw PHP
The library supports Laravel as well as raw PHP. You can easily export data from PDOStatement
and Array
.
From Plain Array
From PDOStatement (RECOMMENDED)
You are always welcome to contribute
All versions of php-csv-exporter with dependencies
ext-pdo Version *