- Requires: PHP >= 7.0.0
- Release Date: TBD
- Supported Until: TBD
<?php use League\Csv\Reader; use League\Csv\Statement; //load the CSV document $csv = Reader::createFromPath('/path/to/your/csv/file.csv') ->setHeaderOffset(0) ->addStreamFilter('convert.iconv.ISO-8859-1/UTF-8') ; //build a statement $stmt = (new Statement()) ->offset(10) ->limit(25) ; //query your records from the document $records = $stmt->process($csv)->fetchAll();
The library was designed for developers who want to deal with CSV data using modern code and without the high levels of bootstrap and low-levels of usefulness provided by existing core functions or third party-code.
Read and Write to CSV documents in a memory efficient and scalable way
Support PHP Stream filtering capabilities
Transform CSV documents into popular formats (JSON, XML or HTML)
Once a new major version is released, the previous stable release remains supported for six more months through patches and security fixes.
League\Csv was created by Ignace Nyamagana Butera. Find him on Twitter at @nyamsprod.