php_b34st Posted August 19, 2006 Share Posted August 19, 2006 I have the following form which allows admins on the site to add news topics. I can retrieve the text from the database and print it where it needs to go, but the problem lies in the formatting of the text for example if a user wanted text to be on 3 lines:onetwothreeinstead the result is one two three. I tried just simply using <pre> but this makes the text exceed the container i have placed it in.Any suggestions? Link to comment https://forums.phpfreaks.com/topic/18062-formatting-text-retrieved-from-mysql-database/ Share on other sites More sharing options...
Yesideez Posted August 19, 2006 Share Posted August 19, 2006 Sounds like you're in need of a line break or am I missing something here?Erm, just thought - when echo'ing the text to the browser try this:[code]echo nl2br($variable);[/code] Link to comment https://forums.phpfreaks.com/topic/18062-formatting-text-retrieved-from-mysql-database/#findComment-77408 Share on other sites More sharing options...
php_b34st Posted August 19, 2006 Author Share Posted August 19, 2006 Yea that works thank you very much for the help Link to comment https://forums.phpfreaks.com/topic/18062-formatting-text-retrieved-from-mysql-database/#findComment-77412 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.