Ok say I have a paragraph of text:
After getting cut for the first and last time in his life, Durant watched from the sofa as the American team waltzed into the gold-medal game and then was tested by Spain, ultimately emerging with a 118-107 victory that ended an eight-year gold-medal drought for the senior U.S. men's national team. But the gold-medal drought for the Americans in the FIBA World Championship remains intact, now at 16 years and counting as Team USA prepares to head to Turkey without any of the members of the so-called Redeem Team from Beijing.
What I would like to do is to run a php preg_match_all a few keywords (say example 'team' and 'for') on the text, and then retrieve a snippet (maybe 10 words before and 10 words after) for each of the result found.
Anyone has any idea how that can be done?