Your code with nested foreach loops is comparing every single element of the secnd array with every single element of the first array. Is this really what you want to do? It doesn't make too much sense to me with the input data.
May be you want to traverse arrays in parallel, i.e., report a match is the nth item of array 1 is equal to the nth element of array 2. At least, this would make more sense to me with your data. In that case, you should not use nested loops, but one loop looping over the indexes (subscripts) and comparing the items for each subscript.
Please clarify what you're trying to achieve.
In reply to Re: Array looping
by Laurent_R
in thread Array looping
by Nansh
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |