title: PHP regex for a word collection around a search phrase
body: <p>Hi I am trying to create a regex that will do the following</p>
  
  <p>grab 5 words before the search phrase (or x if there is only x words there) and 5 words after the search phrase (or x if there is only x words there) from a block of text (when I say words I mean words or numbers whatever is in the block of text)</p>
  
  <p>eg</p>
  
  <p>Welcome to Stack Overflow! Visit your user page to set your name and email.</p>
  
  <p>if you was to search "visit" it would return:
  Welcome to Stack Overflow! Visit your user page to set</p>
  
  <p>the idea is to use preg_match_all in php to give me a bunch of search results showing where in the text the search phrase appears for each occurrence  of the search phrase.</p>
  
  <p>Thanks in advance :D</p>
  
  <p>on a sub note there may be a better way to get to my result if you feel there is please feel free to throw it in the pool as I'm not sure this is the best just the first way I thought of, to do what I need :D </p>