I would like to remove the extra empty lines from the line, but allow one empty line between each line. How:
line1 line2
It should become:
line1 line2
I found the following regex (forgot where I found it):
preg_replace('/^\n+|^[\t\s]*\n+/m','',$message);
This works, but removes all empty lines without leaving an empty line between each line.
Edit: I just created a quick example at http://jsfiddle.net/RAqSS/
source share