title: Return words before and after the first occurrence of a string
body: <p>I have a body of text returned from a search query, lets call it $body.  Now, what I want to do is for the script to find the first occurrence of the search query, $query.  I know I can find this first occurrence this with strripos.  </p>
  
  <p>Once found, I want the script to return a couple of words before the first occurrence of the string as well as a few words after the end of the first occurrence.  </p>
  
  <p>Essentially I'm trying to do what Google does with it's search results.  </p>
  
  <p>Any ideas on where I should start?  My issue is that I keep returning partial words.  </p>