I wondered whether it would be the best and fastest solution in PHP between:
- Read line by line directly with fgets() (while !EOF).
- Get all the content of the file into an array of string and read each element.
Thank you !
I wondered whether it would be the best and fastest solution in PHP between:
Thank you !
Try to compose both methods. Read as much as possible data with fread()
(untill you reach per script memory limit). Then split this data on lines and process it. Then read file again. Thus you decrease disk usage and can manually controll script RAM usage.