RE: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Scott Hurring
Or just use a real text-editor that will properly handle files with "\n" and "\r\n". Anything more advanced than MS Notepad should properly grok what's going on. Unless you're going to be exclusively on Win32, those little bastard "\r"'s can really mess things up... I've had entire scripts refu

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Ross Fleming
Just to clarify, is the problem getting explorer to save the name properly?... or is it still the carriage returns? Isn't it amazing how typewriters are cause problems in todays programming exercises?... :) and yes, u can call me Ross :) R Henry Grech-Cini wrote: > B.A.T.Svensson wrote (poss

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Scott Carr
Try passing the file through preg_replace. Replace all \n with \r\n. -- Scott Carr OpenOffice.org Whiteboard-Doc Maintainer http://whiteboard.openoffice.org/doc/ Quoting Henry Grech-Cini <[EMAIL PROTECTED]>: > Dear All, > > Firstly, I am a newbie to php so please be gentle. > > I'm havin

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Henry Grech-Cini
B.A.T.Svensson wrote (possibly not visible as a post yet) > Are you trying to get line breaks on a web pages with CR/LF? > (IF so: it not possible, use the HTML tag "" to induce a line break.) No I'm not trying to do that, I'm trying to generate a CSV file from a collection of tabels within a My

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Henry Grech-Cini
Dear All (and B.A.T.Svensson in particular) I agree. It should not be necessary with a proper language. Could it be that I need to use a different header as opposed to: header("Content-type: Application/octet-stream"); In anycase doing TrimRight() and adding on a "\n" did not work! Henry "B.

RE: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Svensson, B.A.T. (HKG)
> Congratulations on discovering the difference between windows and linux > carriage returns. :) There are 2 types of new-line character, \r (carriage > return, ie move the cursor back the the left hand side of the screen) and \n > (new line, strictly interpreted as "move cursor down one line, b

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Henry Grech-Cini
Thankyou Ross, (may I call you Ross?) :-) Worked a treat. The correct order is \r\n (\n\r just produces 2 undisplayable characters [][]). I had tried \n\r but hadn't considered using \r\n. Thankyou Thankyou Thankyou Henry "Ross Fleming" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">

RE: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Svensson, B.A.T. (HKG)
> The downloaded file does not contain Windows type carriage returns of > newlines! However it does contains the data thank goodness. > > What is the fix? The problem you encounter is that one system is using soft line breaks weather the other is using hard (never remember which one who did what

Re: [PHP-WIN] Newline in file using fputs

2002-05-16 Thread Ross Fleming
Congratulations on discovering the difference between windows and linux carriage returns. :) There are 2 types of new-line character, \r (carriage return, ie move the cursor back the the left hand side of the screen) and \n (new line, strictly interpreted as "move cursor down one line, but not a