I'm trying to write a few items to a text file but when I use fputs($fp,"\n"); or fputs($fp,"\r"); it just gives some funky block char instead of writing a newline into my file.
So I ask..how do you output a newline character to a text file?
depends on the platform.
could be \r\n for windows or \n for linux/unix or \r\r for macintosh
i think this is correct. if i am wrong, someone please correct me.
YAY! Thank you sir.
Very close! The only correction is that mac uses a single \r, not a double one.
David, Thanks you very much! This was driving me CRAZY. I assumed that the \n newline character would convert itself like it does in Perl depending on the system. Of course you know how that "assume" thing goes...
Is there a way to reset what the \n symbol means in PHP? This would be nice since you could set it once and use \n "normally".
Thanks again! Rick