dink87522 Posted November 30, 2010 Share Posted November 30, 2010 I have a form a user may submit which has a text area. If the user enters "Today is the first day of the week" it will be stored in the database like that (note the carriage returns etc). If I then get that data from the table and echo it, it will print as 'Today is the first day of the week'. How can I print it so that it will retain the user's input formatting/the formatting shown stored in the table? Link to comment https://forums.phpfreaks.com/topic/220241-echoing-multiline-user-input/ Share on other sites More sharing options...
ManiacDan Posted November 30, 2010 Share Posted November 30, 2010 The PHP function nl2br or the HTML tag <pre> -Dan Link to comment https://forums.phpfreaks.com/topic/220241-echoing-multiline-user-input/#findComment-1141354 Share on other sites More sharing options...
PFMaBiSmAd Posted November 30, 2010 Share Posted November 30, 2010 [ot]@dan, the forum has a custom bbcode tag - [m][/m] that you can put around the name of php functions and it creates a link to the corresponding php.net/{functionname} page, i.e. [m]nl2br[/m] would give nl2br[/ot] Link to comment https://forums.phpfreaks.com/topic/220241-echoing-multiline-user-input/#findComment-1141358 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.