Here's what your file contains:

ccadev:/# od -c TEST.txt
0000000    L   I   N   E       O   N   E  \r   L   I   N   E       T   W
0000020    O  \n   L   I   N   E       T   H   R   E   E

Wordpad handles it. Notepad does not.
But you have different line terminators for each line....
Larry Irwin

----- Original Message -----
From: "Kevin Stone" <[EMAIL PROTECTED]>
Sent: Friday, September 06, 2002 2:48 PM
Subject: [PHP] Line Breaks in dynamic Download

> I have a script that allows clients to download their email lists from a
> database.  However I can not get the 'new line' characters (\n \r) to do
> their job in Notepad when the download is prompted and the file saved to
> disk.  I've simplified the problem with the code below.  Both \n and \r
> display as 'null' or undefined characters in Notepad.  What am I doing
> wrong?
> <?
> $file = "LINE ONE\nLINE TWO\rLINE THREE\n\r";
> header("Cache-control: private");
> header("Content-type: application/octet-stream");
> header("Content-Disposition: attachment; filename=TEST.txt");
> echo $file;
> ?>
> Click here to run this code.  You
> be prompted to save the file.  Open the resulting file in Notepad on your
> PC.  Tell me if the newlines show as 'null' characters or if each LINE
> LINE TWO, etc. shows up on their own lines.  Mac users also welcome to try
> in Simpletext/BBedit.
> Much thanks,
> Kevin Stone
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to