Forum Moderators: coopster

Message Too Old, No Replies

perserve formating of text stored in database.

         

supermanjnk

3:47 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



I am creating a small site, that will have content that is uploaded by multiple people, These people will not have knowledge of html so I need to find a way to perserve the formating that they use when they enter the content into the text box, I was going to use the <pre></pre> tags, but when I use them if they do not put a break in then the line will spill over the container that it is in. I am using divs, but I have noticed it does the same thing with tables. My content has a dynamic width so I can't use wordwrap() to set a certain char limit. What would be the best way to handle this? Would it be better to have a script check for line breaks in the submission and add a <br> tag to it?

Nutter

5:24 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



nl2br [us2.php.net] will do it for you.

supermanjnk

8:59 pm on Feb 28, 2005 (gmt 0)

10+ Year Member



Thanks that works perfectly.