3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function NukesSpam($input) { $blacklist = array('domain.com','visual.merriam-webster.com','example.com'); $output=$input; foreach ($blacklist as $a_blacklisted) { $output = preg_replace('/<img(.*?)src=.http(.*?)'.str_replace('.','\.',$a_blacklisted).'(.*?)>/', '<img src="http://standardsurvival.com/faces/64/drusz.png">', $output); } return $output; } echo NukesSpam('<img src="http://www.domain.com/test1.jpg">');
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<img src="http://standardsurvival.com/faces/64/drusz.png">