A practical guide to reading and writing CSV files in PHP, covering both native functions (fgetcsv, fputcsv) and the league/csv library. Topics include basic read/write operations, appending rows, filtering, sorting, CSV-to-JSON conversion, and a key technique for parsing 1-million-line CSV files using only 6MB of memory via streaming.

Sort: