noobstar Posted October 1, 2007 Share Posted October 1, 2007 Hi, im tring to get this to work however, im unsure how to. When you type lets say this into a textarea box and save it into a variable: This is a test 1 2 3 And when you display it through echo it will just show this in a straight line i.e. This is a test 1 2 3. My question is is there a way to retain the breaks inbetween just the way its written in the textarea box ? Thanks again Link to comment https://forums.phpfreaks.com/topic/71320-solved-display-text-with-breaks/ Share on other sites More sharing options...
sKunKbad Posted October 1, 2007 Share Posted October 1, 2007 <?php $text = nl2br('This is a test 1 2 3'); echo $text; ?> Link to comment https://forums.phpfreaks.com/topic/71320-solved-display-text-with-breaks/#findComment-358826 Share on other sites More sharing options...
noobstar Posted October 1, 2007 Author Share Posted October 1, 2007 Thank you very much!! Link to comment https://forums.phpfreaks.com/topic/71320-solved-display-text-with-breaks/#findComment-358830 Share on other sites More sharing options...
sKunKbad Posted October 1, 2007 Share Posted October 1, 2007 My pleasure. Figuring out other peoples problems with php is like a game I play when I'm bored. Keeps me fresh with the php knowledge. Link to comment https://forums.phpfreaks.com/topic/71320-solved-display-text-with-breaks/#findComment-358832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.