3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tdr="<p>Previous reports stated that the Pokemon Alpha.</p><p>On the other hand, Pokemon Diamond and Pearl are reported .</p><p>On the other hand, Pokemon Diamond and Pearl are reported.</p>"; $pos = strrpos($tdr, '<p>'); $newtdr = substr($tdr,0,$pos) . ' Hello <p>' . substr($tdr, $pos + 4); echo $newtdr;
based on Bt0WR
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<p>Previous reports stated that the Pokemon Alpha.</p><p>On the other hand, Pokemon Diamond and Pearl are reported .</p> Hello <p>n the other hand, Pokemon Diamond and Pearl are reported.</p>
Output for 4.3.0 - 4.4.9
<p>Previous reports stated that the Pokemon Alpha.</p><p>On the other hand, Pokemon Diamond and Pearl are reported .</p><p>On the other hand, Pokemon Diamond and Pearl are reported. Hello <p>