I have some code that searches a huge log file and finds a keyword, for the majority of cases this is near the bottom of the document. It would be more efficient in this case to start my search at the bottom and work my way up.
$pos = stripos($body,$keyword);
$snippet_pre = substr($body, $pos, SNIPPET_LENGTH);
I've looked at strripos and although it does what i want as in find the last occurrence it sounds like it searches from the beginning of the document so ill be adding a lot of unnecessary work to my query as most of the keywords are near the bottom of the string/document
Any ideas?