Multiple blank lines with spaces, tabs and new lines to one line?
<p>I know there are similar questions, but i have certain different problems!</p>

<p>I need to convert multiple blank lines to one in PHP, but when I use not only New Lines, but Spaces and New Lines it doesn't work. If there are 2 or more blank lines(with spaces and enter's), they should be converted in only one blank line, when it's only new line(but not
 blank line), it should remain the same.</p>

<p>I used this, but it doesn't work with spaces and new lines:</p>

<pre><code>$string = str_replace(array("\r\n", "\r", "\n", "&lt;br /&gt;", $string);

echo preg_replace("~&lt;br /&gt;(&lt;br\s*/?&gt;[\r\n]*)+~i", "&lt;br /&gt;&lt;br /&gt;", $string);
</code></pre>

<p>I also need it to be displayed in this way in Windows, Linux and Mac!</p>
