[SOLVED] New line in PHP forum

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
yosuke_
Forum Commoner
Posts: 64
Joined: Tue Apr 13, 2004 12:29 pm

[SOLVED] New line in PHP forum

Post by yosuke_ »

Hi!
Im making my own forum. When user will post a post and press enter I need my code to replaca New Line with <br>. How can I do this? In asp it was simple

Code: Select all

Replace(vbcrlf,"<br>")
But how does New line looks like in PHP? Thank you!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

echo nl2br($text);
yosuke_
Forum Commoner
Posts: 64
Joined: Tue Apr 13, 2004 12:29 pm

Post by yosuke_ »

Thank you!
Post Reply