dkirk Posted October 11, 2007 Share Posted October 11, 2007 I have a form that allows users to enter notes into a large textbox. After the form is submitted, the contents of the textbox are echoed out into a report. Below is an example of an entry: These are my notes. These notes doe not make any sense but it gets the point across. When I echo out this entry as a variable, the entry looks like this: These are my notes. These notes doe not make any sense but it gets the point across. I need to keep all of the notes just as they were entered on multiple lines. Does anyone have any ideas on how to fix this? Quote Link to comment https://forums.phpfreaks.com/topic/72848-solved-echo-multi-line-textbox-variable/ Share on other sites More sharing options...
pocobueno1388 Posted October 11, 2007 Share Posted October 11, 2007 Use nl2br() www.php.net/nl2br Quote Link to comment https://forums.phpfreaks.com/topic/72848-solved-echo-multi-line-textbox-variable/#findComment-367355 Share on other sites More sharing options...
sasa Posted October 11, 2007 Share Posted October 11, 2007 use nl2br() function try <?php $a='These are my notes. These notes doe not make any sense but it gets the point across. '; echo nl2br($a) ?> Quote Link to comment https://forums.phpfreaks.com/topic/72848-solved-echo-multi-line-textbox-variable/#findComment-367357 Share on other sites More sharing options...
dkirk Posted October 11, 2007 Author Share Posted October 11, 2007 Thats why I come to this forum, Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/72848-solved-echo-multi-line-textbox-variable/#findComment-367359 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.