what are these called \\r \\n and is there a tutorial that explains them?
"\r" is Carriage return. Mind the double quotes when you use it with PHP! If you use single quotes, You will get the string \r instead of a line break.
BTW, it is suitable to use "\r\n" if you want to put a line break in your text so it will be rendered correctly in different operating systems.