This question has already been answered:
When searching made the text highlighting in this way
foreach ($words_arr as $word) { $str = preg_replace("/{$word}\w*/ui", "<span class='fcolor9'>\\0</span>", $str); } where $str is a string, $word is a word to be highlighted, $words_arr is a search query.
In general, everything works if you set it http://apteka1.net/search?q=Aspirin
But if you set it like http://apteka1.net/search?q=Aspirin +c
It turns out some kind of nonsense.
Tell me who knows where the error is.
$words_arrfrom the$words_arrof the parameter + the desired result and the current one - korytoff