I have multi dimensional array and i have another array
CODE :
SINGLE ARRAY calles as A
Array
(
[pattern] => 91919089
)
MULTIDIMENSIONAL ARRAY called as b
[1] => Array
(
[0] => 42
[1] => VIETNAM
[2] => 84
)
[2] => Array
(
[0] => 46
[1] => 3253
[2] => 235
)
[3] => Array
(
[0] => 48
[1] => india
[2] => 91
)
[4] => Array
(
[0] => 49
[1] => india
[2] => 919
)
[5] => Array
(
[0] => 50
[1] => india
[2] => 9191
)
Multi dimensional array called as c
[1] => Array
(
[0] => 42
[1] => VIETNAM
[2] => 84
)
[2] => Array
(
[0] => 46
[1] => 3253
[2] => 235
)
[3] => Array
(
[0] => 48
[1] => india
[2] => 89
)
[4] => Array
(
[0] => 49
[1] => india
[2] => 089
)
[5] => Array
(
[0] => 50
[1] => india
[2] => 9089
)
Here we can see that pattern 91919089 is matched with 3rd 4th and 5th element of array b and key of 2 of each is 91,919 and 9191 respectively and 5[2]i want result that 9191. = 9191 which is maximum matching string of pattern 91919089 so result is 5
suppose if i will remove 5th element from multi dimensional array then must give me result that 4th is matching with 919. and if no match found then need to match from another array c from end to start postion here we can see in array c 3,4,5 element have 2nd keys are 89,089,9089 respectively and match 9089
Please help me out Thanks in advance.