3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $searchTerm = "ü"; $searchTerm2 = "&uuml;"; $replaceTerm = "%FC"; $test=array("${searchTerm}$searchTerm2/${searchTerm}_.${searchTerm}", "xay${searchTerm}", "asdasd/${searchTerm}.mp3", "${searchTerm}.", "blahahbasd${searchTerm}", "1234${searchTerm}1234"); foreach ($test as $t) echo "$t => " . preg_replace("/". preg_quote($searchTerm . '|' . $searchTerm2) . "/x", preg_quote($replaceTerm) , $t) . "\n";
based on ZaQlI
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
ü&uuml;/ü_.ü => ü&uuml;/ü_.ü xayü => xayü asdasd/ü.mp3 => asdasd/ü.mp3 ü. => ü. blahahbasdü => blahahbasdü 1234ü1234 => 1234ü1234