strpos() with multiple needles?
问题 I am looking for a function like strpos() with two significant differences: To be able to accept multiple needles. I mean thousands of needles at ones. To search for all occurrences of the needles in the haystack and to return an array of starting positions. Of course it has to be an efficient solution not just a loop through every needle. I have searched through this forum and there were similar questions to this one, like: Using an array as needles in strpos Define multiple needles using