Jump to content


This topic is now archived and is closed to further replies.


A stupid Newbie question

Recommended Posts

I have a form that puts text into a MySql database. The text can contain carrage returns to create paragraphs.

When I echo the text into a text area, all looks OK.


When I echo the text direct, the line breaks do not work and everything appears in one line.

How do I echo the text so it appears correctly, including line breaks, without placing in in a text area tag???

this works
[code]<textarea name="textfield" cols="70" rows="12"><?php echo $row_Recordset1['Description']; ?></textarea>[/code]

this don't work
[code]<?php echo $row_Recordset1['Description']; ?>[/code]

Thanks in advance

Share this post

Link to post
Share on other sites
[!--quoteo(post=355888:date=Mar 17 2006, 10:44 AM:name=webwiese)--][div class=\'quotetop\']QUOTE(webwiese @ Mar 17 2006, 10:44 AM) [snapback]355888[/snapback][/div][div class=\'quotemain\'][!--quotec--]

nl2br($yourtext) transaltes linebreaks into <br>.

Thanks Webwiese, works exactly how I want.

Thanks again!

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.