3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = "R&ouml;mer"; $rest = "R&ouml;mer"; $result = "R&ouml;mer"; do { $rest = stristr($rest,$s); $replace = substr($rest,0,strlen($s)); $result = str_replace($replace,"<span class='textHighlight'>{$replace}</span>",$result); $rest = substr($rest,strlen($s)); } while ($rest !== false); echo $result;
Output for 4.3.0 - 7.1.0
<span class='textHighlight'>R&ouml;mer</span>