I get input from the textarea of an HTML form. I store it in a database file. It is normal for people to hit the carriage return (enter) key a couple of times at the end of a paragraph, and start a new one with a blank line inbetween paragraphs.
So far, so good.
I replace the carriage returns \n"; with <br> using the conventional method.
However, you get these people every once in a while, who hit the enter key about 15 times once they have finished typing.
So my question is: How do I retain the carriage returns inbetween paragraphs, but get rid of the carriage returns after the last paragraph?
So far, so good.
I replace the carriage returns \n"; with <br> using the conventional method.
However, you get these people every once in a while, who hit the enter key about 15 times once they have finished typing.
So my question is: How do I retain the carriage returns inbetween paragraphs, but get rid of the carriage returns after the last paragraph?