note 107103 added to function.fwrite
| From: | forum at thehomepagestore dot com | Date: | Sat, 07 Jan 2012 13:38:52 +0000 |
| Subject: | note 107103 added to function.fwrite | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185448@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 70.112.159.226
----
Manual Page -- http://www.php.net/manual/en/function.fwrite.php
Edit -- https://master.php.net/note/edit/107103
Del: integrated -- https://master.php.net/note/delete/107103/integrated
Del: useless -- https://master.php.net/note/delete/107103/useless
Del: bad code -- https://master.php.net/note/delete/107103/bad+code
Del: spam -- https://master.php.net/note/delete/107103/spam
Del: non-english -- https://master.php.net/note/delete/107103/non-english
Del: in docs -- https://master.php.net/note/delete/107103/in+docs
Del: other reasons-- https://master.php.net/note/delete/107103
Reject -- https://master.php.net/note/reject/107103
Search -- https://master.php.net/manage/user-notes.php