3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $paragraph = "<p>With na level of</p><p>bloot hdad fis g gks fsd faf eghejfke jgjeg</p>"; var_dump(preg_replace('/<\/p>$/', '<em>EMEMEMEMEMEM</em></p>', $paragraph));
based on 5cdWS
Output for 4.3.0 - 7.1.0
string(94) "<p>With na level of</p><p>bloot hdad fis g gks fsd faf eghejfke jgjeg<em>EMEMEMEMEMEM</em></p>"