I’ve inherited several PHP scripts that parse data from CSV files and update a database. The CSV files are hundreds of MB, and a significant portion of time spent running the scripts is loading the CSVs.
I would like to maintain the CSVs in memory in-between running the scripts. Is it possible to do this with PHP?
This can be done smoothly with a database support, preferably MySQL. You may import data from CSV into a temporary database and destruct that after the whole processing is done.
You can read about importing CSV data into database here