title: Highlighting Search Terms
body: <p>I have a case where I'm returning database results and displaying them on a page based on a search term.  This part is working fine, but I want to hightlight these search terms by wrapping them in span tags.  I started to write a function that I called on each result that used the str_replace function, but then it dawned on me that this would also affect any text that is in HTML tags.  Does anybody have a function they use to do this effectively?  I'm using PHP 4.
  Thanks!</p>