I have 2 different multidimensional array that are structured in the following way
ARRAY 1
Array
(
[0] => Array
(
[0] => john
[1] => AUTHOR
[2] => PUBLISHER
)
[0] => Array
(
[0] => Smith
[1] => AUTHOR
[2] => PUBLISHER
)
)
ARRAY 2
Array
(
[0] => Array
(
[0] => John
[1] => www.john.com
[2] => D
)
[1] => Array
(
[0] => Smith
[1] => smith.com
[2] => D
)
)
I would like two check if the value "john" from Array1 is available in array2. If it's the case, i retrieve the value of "www.john.com" in array2 and insert it in array 1
This is what i would like to achieve
FINAL ARRAY
ARRAY 1
Array
(
[0] => Array
(
[0] => john
[1] => www.john.com
[2] => AUTHOR
[3] => PUBLISHER
)
[0] => Array
(
[0] => Paul
[1] => AUTHOR
[2] => PUBLISHER
)
)
The array is dynamic, i put static values just to show what i would like to acheive.
Any help on this will be appreciated