3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function str_multiple_replace($str, $needle, $subs) { return vsprintf(str_replace(array('%', $needle), array('%%', '%s'), $str), $subs); } $string = ">>>?<<<%%s>>>?<<<>>>?<<<"; echo str_multiple_replace($string, '?', array('Hello', 'World', '!'));
Output for 4.3.0 - 7.1.0
>>>Hello<<<%%s>>>World<<<>>>!<<<