I'm creating a function which can accept a string which is either retrieved through file_get_contents()
on a local text file, or something fetched from a url such as http://site.com/338383.txt
.
The file will be a tab seperated file, with each item in the file being on its own line. Is it better to use \n
or \r
to explode()
the string and get an array of each line?
I've noticed that in some cases \n
doesn't work. I'd like a consistent way which works all the time. Any thoughts?