Answer the question
In order to leave comments, you need to log in
How to parse a large text file in php?
There is a large, no.. very large file, approximately 1,800,000 * 150 lines.
The need arose to translate it from a text format into mysql for ease of access to information.
I haven't tried parsing it yet, but if it's translated into an array line by line, then .. it probably won't work.
as it should in pieces. what options are there, besides cutting the file into pieces (into a bunch of smaller files)?
and how to open it for editing, even FIG knows
what options there are, where to dig?
Answer the question
In order to leave comments, you need to log in
Use stream_get_line or fgets to read line by line. The fgets manual has a good example.
If the file is structured (eg CSV), then you can use LOAD DATA INFILE dev.mysql.com/doc/refman/5.7/en/load-data.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question