3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<_ <p>my text 1</p><br /> some other content<br /> <p>some other paragraph followed by an html line break</p><br><br /> etc...<br /> _; echo preg_replace('~(</p>)<br ?/?>~', '$1', $str);

preferences:
31.87 ms | 404 KiB | 5 Q