The task is as follows: sphinx returns an array of strings. It is run through the cycle:
foreach ($array as $k => $v) { //здесь код формирующий строку на выход. if(preg_match("#(.*$string.*)#ui",$v)){ //Если найдено похожее слово, то его выделяем $html.="<span style:'red'>$v</span>"; } } The problem is that the words in the array and the search word can differ in case, i.e. different endings.
Or maybe part of another word.
In these cases, if does not work.
Can you advise something?
UPD: Since sphinx has already done a similar job, can someone tell me how to get relevant data from it?