I\'ve seen many developers use different methods to split a string by new lines, but i\'m confused which is the correct: \\r\\n OR \\n only?
\\r\\n
\\n
If you are programming in PHP, it is useful to split lines by \n and then trim() each line (provided you don't care about whitespace) to give you a "clean" line regardless.
\n
trim()
foreach($line in explode("\n", $data)) { $line = trim($line); ... }