title: preg_replace and linebreaks
body: <p>I have a big area of text that I wish to convert to valid HTML. This includes adding a paragraph tag to each new paragraph, how can I do this with PHP? For example adding line breaks like this:</p>
  
  <pre><code>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
  
  Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
  </code></pre>
  
  <p>goes to</p>
  
  <pre><code>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
  
  &lt;p&gt;Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;
  </code></pre>
  
  <p>Can this be achived with preg_replace??</p>
  
  <p>Thanks</p>