Page 1 of 1

simple help!!! for a new

Posted: Mon Apr 07, 2003 3:11 am
by valentik
You could tell me why echo "This will not expand: a newline\n"; does not work

Posted: Mon Apr 07, 2003 3:22 am
by twigletmac
What do you mean by 'does not work'? What are you trying to achieve and what is going wrong?

Mac

Posted: Mon Apr 07, 2003 3:27 am
by d1223m
remember \n's do nothing in html
view the source _then_ you can see the \n's

to get linebreaks use <br>\n ( still use the \n for neat and tidy html )
or there is the function nl2br() eg:

print nl2br("hello\ntesting\n");

prints:
hello<br>\n
testing<br>\n