lostprophetpunk Posted October 6, 2008 Share Posted October 6, 2008 I have made a simply blog system using PHP, but however I really need to get my textarea's in my forms sorted out. What I have had to do at the moment is use streg_replace() to create a function to allow me to do a new line. But what I am looking for is you know with textarea's, they follow the line along one the text is at the end of that, and carry on, but when the user themselves makes a new line with enter, it will show like that in the outputted text. Such as if I was to put the following text into the textarea... ________________________________ |This will be a single sentence, even | |though it is on a new line in the text | |area. | | | |This however, will show two lines | |below the above text when it is | |outputted. | |________________________________| So the above would show something like... This will be a single sentence, even though it is on a new line in the text area. This however, will show two lines below the above text when it is outputted. Rather than something like... This will be a single sentence, even though it is on a new line in the text area. This however, will show two lines below the above text when it is outputted. ...when the data is echoed onto the page. So how would I go about doing this. Quote Link to comment Share on other sites More sharing options...
R0bb0b Posted October 6, 2008 Share Posted October 6, 2008 I think the function you are looking for is nl2br(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.