note 27239 added to function.fopen
| From: | Michele dot Manzato at rack1 dot php dot net | Date: | Thu, 28 Nov 2002 16:15:39 +0000 |
| Subject: | note 27239 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40076@lists.php.net to get a copy of this message | ||
Actually there is a further undocumented open mode, "wt", that allows one to have
end-of-line chars correctly written under Win32:
$fp = fopen("foo.txt", "wt");
fwrite($fp, "Hello\nthere!\n");
fclose($fp);
correctly write 2 CR-LF sequences under Win32, while:
$fp = fopen("foo.txt", "w");
fwrite($fp, "Hello\nthere!\n");
fclose($fp);
does not - the resulting file is garbled in Notepad.
Have fun
Michele
--
http://www.php.net/manual/en/function.fopen.php
http://master.php.net/manage/user-notes.php?action=edit+27239
http://master.php.net/manage/user-notes.php?action=delete+27239
http://master.php.net/manage/user-notes.php?action=reject+27239