Wednesday, October 5, 2011

PHP fwrite/fputs Newline Problem in IIS7

The problem I encountered is that I couldn't write a newline to the file under PC environment.

Then I tried this and it worked:

fwrite($fh, "My Text...\r\n");

Instead of just \n, I need to have the \r\n pair under PC environment. No such issue using PERL under PC. Weird.

No comments:

Post a Comment