3v4l.org

run code in 300+ PHP versions simultaneously
<?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;

preferences:
36.74 ms | 402 KiB | 5 Q