|
Posted by AlexVN on 06/18/06 20:17
Pete wrote:
> Is it OK to save the body with \r\n line breaks, or will this mess up
> reading the file later with fgets()? How does fgets() deal with \r\n line
> breaks?
Pete,
fgets does nothing with line breaks on unix/linux systems. However, it
converts line breaks on windows systems, when the file handler was
opened in text mode. Please have a look at http://php.net/fopen:
"Note: Different operating system families have different line-ending
conventions. When you write a text file and want to insert a line
break, you need to use the correct line-ending character(s) for your
operating system. ... Windows offers a text-mode translation flag ('t')
which will transparently translate \n to \r\n when working with the
file. In contrast, you can also use 'b' to force binary mode, which
will not translate your data."
Sincerely,
Alexander
http://www.alexatnet.com/
Navigation:
[Reply to this message]
|