title: Replace Multiple New Lines in One New Line
body: <p>I want to replace multiple Newline characters with one Newline character, multiple spaces with a single space and Insert In to database.<br>
  so far I tried this
          <code>preg_replace("/\n\n+/", "\n", $text);</code> and doesn't work !</p>
  
  <p>I also do this job on the $text for formatting.</p>
  
  <pre><code>    $text = wordwrap($text,120, '&lt;br/&gt;', true);
      $text = nl2br($text);
  </code></pre>