here is simple function to highlight only match text.
function highlighter_text($text, $words)
{
$split_words = explode( " " , $words );
foreach($split_words as $word)
{
$color = "#e5e5e5";
$text = preg_replace("|($word)|Ui" ,
"$1" , $text );
}
return $text;
}
call function