3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $replace = array( "/(dog)/i", "/(cat)/i" ); $with = '<strong>$1</strong>'; $str = "I like Dog and cAT"; $str = preg_replace($replace, $with, $str); echo $str;
Output for 4.3.0 - 7.1.0
I like <strong>Dog</strong> and <strong>cAT</strong>