I got the following array (shortened … multiple dot mean that they are data there, both array start at entry 1 until the end.
Array
(
[12U_S_136_15_29_141] => Array
(
.....
[35] => Array
(
[stop_sequence] => 35
[stop_id] => 1601394
)
.....
[46] => Array
(
[stop_sequence] => 46
[stop_id] => 122052
)
[47] => Array
(
[stop_sequence] => 47
[stop_id] => 136208
)
[48] => Array
(
[stop_sequence] => 48
[stop_id] => 128163
)
)
[12U_S_141_57_6_141] => Array
(
[1] => Array
(
[stop_sequence] => 1
[stop_id] => 1601394
)
.....
[12] => Array
(
[stop_sequence] => 12
[stop_id] => 122052
)
[13] => Array
(
[stop_sequence] => 13
[stop_id] => 136208
)
[14] => Array
(
[stop_sequence] => 14
[stop_id] => 128163
)
)
)
As you can see, both array end are equal… 35 = 1, 46 = 12, …, 48 = 14. By equal, I mean the same stop_id but will always be diffrent for stop_sequence and of course the array entry number.
I want to know how I can compare the entire array against the other so I can know if, here let’s say, the second array match the first one at 100% (except we don’t look for stop_sequence so this can be different. So in this case, both will be mark as “equal”, but if let’s say the last entry had a different stop_id (entry 48 would be != from the entry 14), the array will be mark as “not equal”.
Anyone have a path to lead me ? I keep thinking but do not know how. I’ve tryed array_compare but this leaded to nothing :\
Thanks
EDIT
Nothing can be change to the database. Also, the array need to be created this way (with weird text, ie 12U_S_136_15_29_141). I can do whatever in PHP.
fetch the stop_id in to new array:s and compare thous
here is a useful function
then just compare the arrays
or if you know what stop_id that matches: