In PHP I am using stristr search but I also want to return and display the surrounding characters each side of the found string, like concordancer. About 9 or 10 characters should be enough, for example: 'below' is the string I have found, but then I want to display context for my users, like this: 'if I sat below the deck'
My current code is
if (stristr($order, $en[$i])) {
$lit= "".$en[$i]."";
$order = str_replace($en[$i], $lit, $order, $count);
$total = $total + $count;
$sub[$loc[$i]] = $sub[$loc[$i]] + $count;
$carreau[$loc[$i]] = $carreau[$loc[$i]]."".$lit." ";
}
Thank you so much for any help.