coderb Posted January 8, 2008 Share Posted January 8, 2008 Hi All, Have a question, probably quite simple but need help please. I have a database text column containing sentences with line breaks (crlf). When used in an input field type=textarea, the line breaks are displayed correctly. But when I echo that value a table as follows : echo '<td>'.$rowSQL['mycontent'].'</td>'; it loses the line breaks. How do I keep the crlfs? thanks, Quote Link to comment https://forums.phpfreaks.com/topic/84991-solved-how-to-dispay-crlf/ Share on other sites More sharing options...
vbnullchar Posted January 8, 2008 Share Posted January 8, 2008 I didnt fully understand you question "it loses the line breaks. How do I keep the crlfs?" see code below: echo '<td>'.nl2br($rowSQL['mycontent']).'</td>'; Quote Link to comment https://forums.phpfreaks.com/topic/84991-solved-how-to-dispay-crlf/#findComment-433424 Share on other sites More sharing options...
coderb Posted January 8, 2008 Author Share Posted January 8, 2008 Hi, thanks you answered my question. Apologies for the unclear description - I used the term 'line breaks' and 'crlf' reffering to the same thing. thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/84991-solved-how-to-dispay-crlf/#findComment-433453 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.