knowram Posted June 5, 2007 Share Posted June 5, 2007 I have a text box on my form. If i type something into it and use the enter key to put things on different lines it seems to go into the database correctly. But then if I use an echo or print statement to print the info on the page later it removes the returns. how can fix this problem? Thanks for the help Quote Link to comment Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 www.php.net/nl2br Quote Link to comment Share on other sites More sharing options...
knowram Posted June 5, 2007 Author Share Posted June 5, 2007 cool however that seems to double space things Quote Link to comment Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 Than you have double \n's I guess you could do this instead $string = str_replace("\n\n", "<br />", $string); Quote Link to comment Share on other sites More sharing options...
knowram Posted June 5, 2007 Author Share Posted June 5, 2007 cool thanks that did it 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.