title: Replace 2 \n in text to <br \> in php?
body: <p>i know the <code>nl2br</code> function in php to replace '\n' to <code>&lt;br \&gt;</code>, </p>
  
  <p>but how to replace \n\n to <code>&lt;br \&gt;</code>.</p>
  
  <p>for example:</p>
  
  <pre><code>string=
  
  'paragraph
  1
  
  paragraph2'
  </code></pre>
  
  <p>it is expected to show </p>
  
  <pre><code>paragraph1
  
  paragraph2
  </code></pre>
  
  <p>p.s. i have a form to input the text.
  Any help is most appreciated :)</p>