I have a large number of flat text files on my website and I have written some custom PHP routines to load and parse them. I use the “array” command to read the files and this worked fine until recently.
I created the flat files on a Windows systems and then FTP’d them to the UNIX web server. I -suspect- that the FTP command automatically strips out the Windows specific “/r” part of the line ending during the transfer and the files subsequently seem to parse fine.
Unfortunately my web host has recently forced me to use secure FTP and it seems that as a result of this, the files get transfered with the windows “/r” character intact. Furthermore, the files will no longer parse correctly.
I might have made the wrong assumptions in the above, but all that I know for certain is that files (previously) sent with FTP parse fine with the array command, but files now sent with SFTP won’t parse correctly.
Does anyone have any ideas for a quick and simple fix?
Thanks…Sean.