Page 1 of 1

Question about \n...

Posted: Wed May 29, 2002 3:53 pm
by Pestilence
I'm trying to send some pipe-delimited text lines to a file and place a newline at the end of each line. In the future I may also want to change this function to output html to the file, so i've built the routine so that I can specify the delimiter and line end strings so that they can be replaced with <tr>,<td>,</td>,</tr>, etc... When I do this:

Code: Select all

$EndLine = "\n";
fwrite($fp, $BeginLine.$FirstPart.$Sep1."D".$Sep2.$SecondPart.$Endline);
it doesn't write the newline characters to the file, yet when I do this:

Code: Select all

fwrite($fp, $BeginLine.$FirstPart.$Sep1."D".$Sep2.$SecondPart."\n");
it does... why?

Re: Question about \n...

Posted: Wed May 29, 2002 5:04 pm
by Anthron
watch closely:

Code: Select all

$End&#1111;b]L&#1111;/b]ine = "\n";
fwrite($fp, $BeginLine.$FirstPart.$Sep1."D".$Sep2.$SecondPart.$End&#1111;b]l&#1111;/b]ine);
Isn't php case sensitive? wouldn't that have to be an uppercase ;?

OMFG!!!

Posted: Wed May 29, 2002 5:37 pm
by Pestilence
:oops: oi - i'm obviously a relative n00b here... thanks much and sorry for clogging the forum up with this one :D