PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
valentik
Forum Newbie
Posts: 2 Joined: Mon Apr 07, 2003 3:11 am
Contact:
Post
by valentik » Mon Apr 07, 2003 3:11 am
You could tell me why echo "This will not expand: a newline\n"; does not work
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Mon Apr 07, 2003 3:22 am
What do you mean by 'does not work'? What are you trying to achieve and what is going wrong?
Mac
d1223m
Forum Commoner
Posts: 80 Joined: Mon Mar 31, 2003 5:15 am
Location: UK, West Sussex
Post
by d1223m » Mon Apr 07, 2003 3:27 am
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