I have a multi-dimensional array say,
Array
(
[0] => Array
(
[id] => 1
[email_id] => [email protected]
[password] => test
)
[1] => Array
(
[id] => 2
[email_id] => [email protected]
[password] => test
)
[2] => Array
(
[id] => 3
[email_id] => [email protected]
[password] => pass
)
)
Here in the above array, password key has same value in two keys, i need to merge the arrays which have duplicate values to get the following output,
Array
(
[0] => Array
(
[0] => Array
(
[id] => 1
[email_id] => [email protected]
[password] => test
)
[1] => Array
(
[id] => 2
[email_id] => [email protected]
[password] => test
)
)
[1] => Array
(
[id] => 3
[email_id] => [email protected]
[password] => pass
)
)
How to do this ? i've tried array_merge & foreach loops, but i can't get this output
password
? – Teena Thomas Jan 7 at 18:49