Jump to content

line breaks


dadamssg

Recommended Posts

i having a place were users can leave comments and replies in a text box. i want whenever they push the enter button on the keyboard and it goes to the next line, i want that to show up when i retrieve it from the db...how would i program the Enter button to produce a linebreak? this ==>              blah

                  blah

                  blah

                  blah

 

is outputted as blah blah blah blah

Link to comment
https://forums.phpfreaks.com/topic/152880-line-breaks/
Share on other sites

You should store it in the database in it's raw format (not as <br>) meaning the "\n" then use the function wildteen pointed out when retrieving the data from the database for displaying. Reason for this, you may want to use that data in something other than html output (xml, csv, text) etc. This way you can easily do what you want with the data as necessary.

Link to comment
https://forums.phpfreaks.com/topic/152880-line-breaks/#findComment-802881
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.