That would be a much more complex bit of code.
you could explode the string into an array, then loop through the array to find the search phrase then show it along with the word before or after. A very quick sample of the code for that would look like:
<?php
$searchPhrase = "this is some stuff on my page, I hope you like it";
$searchTerm = "stuff";
$searchIndex = "";
$searchArray = explode(" ", $searchPhrase);
foreach($searchArray as $key => $value) {
if($value == $searchTerm) $searchIndex = $key;
}
echo($searchArray[$searchIndex-1]." <span style=\"color:red;\">".$searchArray[$searchIndex]."</span> ".$searchArray[$searchIndex+1]);
?>
of course, there are a number of scenarios this code does not account for, what if the search phrase is the first word? last word? it is meant as an example of one direction you could go.