using str_ireplace to show a search phrase in some content, but I don't want to highlight HTML, e.g. email address
<p>So I've got this little function which highlights the searched phrase, e.g. search for 'Group' and you get a list of pages, choose one and on that page the phrase 'Group' is highlighted using a span class.</p>

<p>Problem is, there is an email address on the page, and the html part (mailto) gets output and it looks messy...</p>

<p>0845 375 2318        Mon-Fri 9am-5.30pm, Calls at local call rate
Email address - groups@cruiseandmaritime.com">groups@cruiseandmaritime.com </p>

<p>Note the "> between the email addresses</p>

<p>It also breaks  tags where the search phrase is identified in the image filename.</p>

<p>Any ideas how I can not to the highlight if the phrase is picked up in the code ?</p>

<pre><code>    function highlightWords($string, $words) {
        foreach ( $words as $word )
        {
            $string = str_ireplace($word, '&lt;span class="soldout"&gt;'.$word.'&lt;/span&gt;', $string);
        }
        /*** return the highlighted string ***/
        return $string;
}
</code></pre>
