Hello,
I have a basic newbie question. I want to search a long string and return all the matches. The search is for "abc", but I want to return "abc" AND the next 5 characters.
I have tried a combintation of substr and strstr something like
substr(strstr($input, $search), 0, 5)
but this only returns the 1st occurance of "abc" and disregards all the following ones.
I have also tried
ereg($search, $input)
where $search is "abc....." but this just returns true. Does this function just find the first instance and quit when it finds a match?
Ideally I would like to get all of the matches in an array.
Any suggestions.