jcanker Posted August 25, 2007 Share Posted August 25, 2007 Is there a php string function that will preserve the line breaks that a user enters into a <textarea> on a form? I've been manually using <p> or <BR> in the textarea, and now that I'm opening up the form to other users, I can't rely on them using it. These forums are able to do it....how is it done? Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 25, 2007 Share Posted August 25, 2007 u mean nl2br() ?? Quote Link to comment Share on other sites More sharing options...
jcanker Posted August 25, 2007 Author Share Posted August 25, 2007 I suppose.... Does that preserve when the user hits enter to move to the next line, or does nl2br only work if /n is entered? Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 25, 2007 Share Posted August 25, 2007 When the user presses a enter in a textarea, a newline is generated. To correctly display the newlines in html, u need to convert them to BRs, so nl2br() will do it. Quote Link to comment Share on other sites More sharing options...
jcanker Posted August 25, 2007 Author Share Posted August 25, 2007 Cool.. thank you! 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.