3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = "Oele\nBoele\n\nDus Want\n\nBlaaaaaaaaaaaa"; $text = '<p>' . $text . '</p>'; $text = preg_replace('#\n\n#', '</p><p>', $text); $text = preg_replace('#\n#', '<br />', $text); $text = preg_replace('#><#', ">\n<", $text); echo $text;
Output for 4.3.0 - 7.2.0
<p>Oele<br />Boele</p> <p>Dus Want</p> <p>Blaaaaaaaaaaaa</p>