I want to convert
<p>Code is following</p>
<pre>
<html><br></html>
</pre>
to
<p>Code is following</p>
<pre>
<html>
</html>
</pre>
I don’t know how to write regular expression for replace between pre tag in PHP.
I tried this code Replace newlines with BR tags, but only inside PRE tags
but it’s not working for me.
Which answer are you using code from?
Assuming it was the accepted answer, just reverse the
preg_replace()line as follows;