Mettez en surbrillance le texte de la recherche dans PHP

function highlightWords($text, $word){
    $text = preg_replace('#'. preg_quote($word) .'#i', '<span style="background-color: #F9F902;">\\0</span>', $text);
    return $text;
}

//function calling
highlightWords($desc, $search_word);
Mr. Samy