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 Link to comment https://forums.phpfreaks.com/topic/54343-posting-text-box-info/ Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 www.php.net/nl2br Link to comment https://forums.phpfreaks.com/topic/54343-posting-text-box-info/#findComment-268738 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 Link to comment https://forums.phpfreaks.com/topic/54343-posting-text-box-info/#findComment-268744 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); Link to comment https://forums.phpfreaks.com/topic/54343-posting-text-box-info/#findComment-268746 Share on other sites More sharing options...
knowram Posted June 5, 2007 Author Share Posted June 5, 2007 cool thanks that did it Link to comment https://forums.phpfreaks.com/topic/54343-posting-text-box-info/#findComment-268750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.