public static function highlightPhrase($str, $phrase, $tag_open = '<strong>', $tag_close = '</strong>') { if ($str == '') { return ''; } if ($phrase != '') { return preg_replace('/(' . preg_quote($phrase, '/') . ')/i', $tag_open . "\\1" . $tag_close, $str); } return $str; }