3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "Dette er en test af F&oslash;rste af de f&oslash;r omtalte tests"; $search = "F&oslash;"; $pos = 0; $loop = true; while($loop) { # Check if the word can be found in the text $pos = stripos($html,$search,$pos); if($pos !== false) { $spanStart = "<span style='background-color:khaki;'>"; $spanEnd = "</span>"; $html = substr($html,0,$pos) . $spanStart . substr($html,$pos,strlen($search)) . $spanEnd . substr($html,$pos+strlen($search),strlen($html)); $pos = $pos + strlen($search) + strlen($spanStart) + strlen($spanEnd); } else { $loop = false; } } echo "html=[$html]";
Output for git.master, git.master_jit, rfc.property-hooks
html=[Dette er en test af <span style='background-color:khaki;'>F&oslash;</span>rste af de <span style='background-color:khaki;'>f&oslash;</span>r omtalte tests]

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
48.7 ms | 401 KiB | 8 Q