Re: \n outputs \r\n ??

From: Date: Thu, 29 May 2003 22:37:18 +0000
Subject: Re: \n outputs \r\n ??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-149501@lists.php.net to get a copy of this message
At 2003-05-29 11:38 -0700, Michael Isaacs wrote: >Still new to PHP - any assistance would be very much appreciated... > >I am using a php script to send info to a local file for mail filtering. >Whe the php script sends the following: > >fputs($nf, "MAILDIR=$MAILDIR # Default mail directory\n"); > >the output actually has a chr 13, 10 You're probably running under Windows. Try using fopen('file','wb'). The 'b' stands for 'binary' and it should prevent the expansion of LF to CRLF. It's mentioned in a note on the manual page of fopen(); Greetings, Jaap -- Chip Directory -- http://www.chipdir.biz/ -- http://www.chipdir.info/ -- http://www.chipdir.net/ -- http://www.chipdir.nl/ -- http://www.chipdir.org/ -- And about 30 other mirror sites world-wide. -- -- To subscribe to a free 'chip issues, questions and answers' -- mailing list, send a message to listguru@fatcity.com with -- in the body 'subscribe chipdir-L'. About 500 experts are -- willing to think with you about electronics problems etc.

« previous php.general (#149501) next »