3v4l.org

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