simple help!!! for a new

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

Post Reply
valentik
Forum Newbie
Posts: 2
Joined: Mon Apr 07, 2003 3:11 am
Contact:

simple help!!! for a new

Post by valentik »

You could tell me why echo "This will not expand: a newline\n"; does not work
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

What do you mean by 'does not work'? What are you trying to achieve and what is going wrong?

Mac
User avatar
d1223m
Forum Commoner
Posts: 80
Joined: Mon Mar 31, 2003 5:15 am
Location: UK, West Sussex

Post 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
Post Reply