title: convert javascript replace to php preg_replace or str_replace
body: <p>I have the two javascript replace commands which work pefectly. I need to make them work in PHP.</p>
  
  <pre><code>var body = body.replace(/\n\n&lt;blockquote&gt;/g, '&lt;blockquote&gt;');
  var body = body.replace(/&lt;\/blockquote&gt;\n\n/g, '&lt;\/blockquote&gt;');
  </code></pre>
  
  <p>I have tried many, many different regex possibilites and many str_replace's but all of them fail. What I thought would work is below, but they do not:</p>
  
  <pre><code>$body = preg_replace('/\n+&lt;blockquote&gt;/gi', '&lt;blockquote&gt;', $body);
  $body = preg_replace('/&lt;/blockquote&gt;\\n+/gi', '&lt;/blockquote&gt;', $body);
  
  $body = str_replace( "\n\n&lt;blockquote&gt;", "&lt;blockquote&gt;", $body);
  $body = str_replace( "&lt;blockquote&gt;\n\n", "&lt;/blockquote&gt;", $body);
  </code></pre>
  
  <p>Basically, I just need to remove the two newlines which surround the blockquote tags. Yes, I have confirmed they are new lines and not carriage returns.</p>
  
  <p>Thanks in advance!</p>