how to highlight text containing variable character (e.g. ', %, $, numbers)
<p>I have a code that highlights a phrase. It works when the phrase is just words without variable symbol ($), numbers and symbols such as(',*,$,). Below is my code.  So what should I do to highlight the exact phrase? </p>

<pre><code>if (!empty($_GET['gid'])) {
    function highlightWords($string, $words)
    {
        $string = str_ireplace($words, '&lt;span class="highlight_word"&gt;'.$words.'&lt;/span&gt;', $string);
        /*** return the highlighted string ***/
        return $string;
    }

    /*** example usage ***/
    $string = file_get_contents('referencefiles/Microsoft.txt', FILE_USE_INCLUDE_PATH);
    $words = 'Paper August 2003'; 

    /*** highlight the words ***/
    $string = highlightWords($string, $words);
    echo $string; 
}
?&gt;
</code></pre>
