title: Stripping away text and replcing <p> with /n with php
body: <p>My output from another program is e.g.</p>
  
  <pre><code>&lt;a href="blah@blah.com"&gt;blah@blah.com&lt;/a&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>abc&lt;/p&gt;
  &lt;p&gt;xyz&lt;/p&gt;
  &lt;p&gt;blah blah blah&lt;/p&gt;
  </code></pre>
  
  <p>I still need the newline if <code>&lt;p&gt;&lt;/p&gt;</code> appears, and I don't want the mailto link of the email as I am going to put them in textboxes.
  Using php to replace, I could not get it done.</p>
  
  <pre><code>$afterClean = str_replace("&lt;p&gt;", "\n",$beforeClean);
  </code></pre>
  
  <p>What have I done wrong, and what is the easiest way to strip away all html codes (I can forgo everything between sharp arrows "&lt;>" except  "p" as I need to replace with newline.</p>