This question has already been answered:
It is necessary to replace the same, but with additives. In English it works, with the Russian problem (does not change). tested here . I tried with mb_ereg_replace, but it also did not work ....
$text = "Слово слоВо Test tesT"; $word = 'слово'; $text = preg_replace('/(' . $word . ')/i', '<b>\\1</b>', $text); $word = 'test'; $text = preg_replace('/(' . $word . ')/i', '<i>\\1</i>', $text); echo $text;
umodifier so that it works correctly with UTF-8. - Visman