I made a script to insert text to database from a form's textfield.
How can remove extra line breaks. It should be ok to have one line break (which is converted into a <br />) and two line breaks (which are converted into a <p>).
Best and easiest way to do this?