note 107103 deleted from function.fwrite by danbrown
| From: | danbrown@php.net | Date: | Mon, 09 Jan 2012 18:30:04 +0000 |
| Subject: | note 107103 deleted from function.fwrite by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185486@lists.php.net to get a copy of this message | ||
Note Submitter: forum at thehomepagestore dot com
----
I searched all over for a way to write end of line characters to a text file in PHP. I kept seeing
notes about using "\r\n". But that only caused those characters to appear in the text
file. I was expecting to find something like writeln. After using a hex editor to look at a text
file, I could see the two characters, 0D0A, at the end of every line. So, if you append these two
characters to the end of each line, you get a pretty carriage return line feed.
fwrite($writeBuffer . chr(13) . chr(10));
I have been coding a while but new to PHP... I use PHP manual alot... thanks for providing this
service.