I am writing a TXT file using PHP. I want to insert actual line breaks into the TXT file wherever necessary. I have tried all combinations of \n \r \r\n \n\r … but these are not causing any linebreaks to appear – in most cases, I am seeing the text “\n” appear in the TXT file, with no linebreak.
I have also tried chr(13).
Any other ideas would be appreciated.
Sounds to me like you might be using single quotes, i.e.
'\n'rather than"\n".If you wanted to continue with a single quotes bias (as you should!), two options: