Forum Moderators: coopster

Message Too Old, No Replies

A little space?

         

Shaman13

9:56 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



I am wondering if anyone knows how to automatically insert a carriage return or several returns between sequential entries in a text field. I am using Php and MySQL. The situation runs like this. I have a text field where the user keeps notes. They may make a number of different entries over time on repeated visits to the page. The problem. When I print a report with this information it bunches all the text together making the notes very difficult to read. So two entries in the field look like this on my web page.

Entry #1 The quick brown dog jumped over the red fox.

Entry#2 The red fox took it all calmly.

But when I print the report with this field in it it comes out like this

Entry #1 The quick brown dog jumped over the red fox.Entry#2 The red fox took it all calmly.

Any and all suggestions are really appreciated.

jatar_k

6:23 am on Feb 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you can do it by adding /r/n to the end of each line. Make sure you have the /r/n in double quotes not single or it won't work, as they won't resolve but be treated as literal strings.

johnnie

12:44 pm on Feb 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The \n and \r-characters do not work in HTML. You should convert them to <br>-tags, since your browser understands these. Use the nl2br-function for this.