replace <br> to new line between pre tag

Posted by saturngod on Stack Overflow See other posts from Stack Overflow or by saturngod
Published on 2010-06-12T10:27:33Z Indexed on 2010/06/12 10:33 UTC
Read the original article Hit count: 207

Filed under:
|

I want to convert

<p>Code is following</p>
<pre>
&lt;html&gt;<br>&lt;/html&gt;
</pre>

to

<p>Code is following</p>
<pre>
&lt;html&gt;
&lt;/html&gt;
</pre>

I don't know how to write regular expression for replace between pre tag in PHP.

I tried this code http://stackoverflow.com/questions/1517102/replace-newlines-with-br-tags-but-only-inside-pre-tags

but it's not working for me.

© Stack Overflow or respective owner

Related posts about php

Related posts about regex