PDA

View Full Version : newlines? wtf?


wripp
09-14-02, 21:37
Okay.. call me a retard or whatever but i'm having a problem getting newline escape characters to work right... this is what i did:

echo "test \n test2";

and the output was:

test test2


---

why the heck does a\n not work the way it's supposed to? Is this something that needs to be enabled in the .ini file or what?


thanks..

MattR
09-15-02, 12:32
Remember HTML does not use newlines but <BR>

If you view the page source you will see the newlines

wripp
09-15-02, 15:31
So why is it then, that the PHP manual itself tells me to use escape characters to make newlines if I so choose? Look it up.. "echo()" in the help files.

Now, if this is the case only when working with files, then it would have been nice to have the manual say straight up "yo, echo() with escaping characters won't transalte in HTML, doOd!"

*shrug

thanks for your reply.