glenelkins Posted December 18, 2006 Share Posted December 18, 2006 HiSay I have a bunch of text in the database that is simply just text with line breaks to seperate paragraphs. How can i display this on the webpage to show exactly as the text is typed. At the moment without HTML tags in there it comes back as one long stream of unformatted text Link to comment https://forums.phpfreaks.com/topic/31097-display-data-with-new-line-char/ Share on other sites More sharing options...
glenelkins Posted December 18, 2006 Author Share Posted December 18, 2006 its ok, can use as such$content = eregi_replace("\n","<br>",$content); Link to comment https://forums.phpfreaks.com/topic/31097-display-data-with-new-line-char/#findComment-143584 Share on other sites More sharing options...
redbullmarky Posted December 18, 2006 Share Posted December 18, 2006 have a look at the [url=http://www.php.net/nl2br]nl2br[/url] function, which will do exactly what you're after.CheersMark Link to comment https://forums.phpfreaks.com/topic/31097-display-data-with-new-line-char/#findComment-143586 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.