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"; echo preg_quote($searchTerm) . '|' . $searchTerm2;
based on 5DoM1
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
ü&uuml;/ü_.ü => %FC%FC/%FC_.%FC xayü => xay%FC asdasd/ü.mp3 => asdasd/%FC.mp3 ü. => %FC. blahahbasdü => blahahbasd%FC 1234ü1234 => 1234%FC1234 ü|&uuml;