phlib / csv
A CSV parsing library; Prevents out of memory errors when parsing large files without a closing string delimiter
Requires
- php: ^7.4 || ^8.0
- guzzlehttp/psr7: ^2
- psr/http-message: ^1.0
Requires (Dev)
Suggests
- ext-zip: Required to open CSV files from Zip archives
README
A CSV parsing library; Prevents out of memory errors when parsing large files without a closing string delimiter
Install
Via Composer
$ composer require phlib/csv
Usage
$stream = stream_for(fopen($filename, 'r')); // Must be a *seekable* stream $csv = new \Phlib\Csv($stream); foreach ($csv as $row) { print_r($row); }
License
This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.