Is it safe to split csv files using the \n character using explode() or should I also include \r to be safe? 90% of the files will be coming from windows computers and probably converted from .xls files using ms excel.
Is it safe to split csv files using the \n character using explode() or
Share
You want to use fgetcsv/fgets in combination with auto_detect_line_ending.
You need to count? Incrementing a counter in fgetcsv will you save alot of ram and (cpu)time instead of a complete read-in and a additional looping to count the read-in.
And also you will be more flexible if you change your mind and yet want to save a row or even particular cells for a later processing.