Is there any way to stop a foreach loop nested inside another foreach loop without stopping both?
I'm doing a simple comparision of two very large (70K) arrays using foreach loops to find entries present in the first array but not in the second. The problem is the size of the arrays makes PHP timeout. I did increase the max execution time to 10 minutes (not enough) but with almost 6 billion comparisons I figured there had to be a better way.
So I used a while loop between the foreach loops. When a match is found the script goes to the item in the array.
The problem is when no match is found the while loop never exits. I can't figure out how to get the while loop to stop at the end of the inner loop.
Would turning the inner loop into a function help?