I am looking for help to write an efficient PHP algorithm to help me find occurances of a String within another string. Here is currently the situation.
I have two arrays. The first array is the array with text that needs searched (haystack). The second array is an array of terms ot find (needle).
I know that my first array has at least one of my terms from the needles. So, the algorithm needs to say 'is array2[0] found inside array1[0]? if not, loop, is array2[1] found inside array1[0], etc' If it is found, exit, advance array1[1] pointer and repeat the process.
I want to make sure this is efficient as I have 10s of 1000s of entries to pricess, and my needle array has 1100 individual needles.