I have a content like below.
I want the <pre></pre> to be converted to <p> </p>. But i'm not able achieve it. Below is an example
$content = "<pre>This is a pre text I want to convert it to paragraphs ";
print_r(str_replace(array('<pre>', '</pre>', ' '),array('<p>', '</p>', '<br/>'),htmlspecialchars($content)));
But i get the output as it is. Can someone help me resolve. Thanks in advance
<pre>Thisgive space between<pre>andThisand tryhtmlspecialcharsis the culprit. You are changing the$contentbefore replacing it.