I have my code removing the <p>
starting tags, but now I want to replace the ending </p>
tags with line breaks. How can I do this?
This is what I have:
$content = 'This is the content';
$newcontent = preg_replace("/<p[^>]*?>", "", $content);
$newcontent = preg_replace("</p>", "<br />", $newcontent);
$content = preg_replace('#<p(.*?)>(.*?)</p>#is', '$2<br/>', $content);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With