Füge doppelte Array-Werte in einem mehrdimensionalen Array-PHP zusammen
Ich habe ein mehrdimensionales Array sagen,
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
)
)
Hier im obigen Array hat der Passwortschlüssel den gleichen Wert in zwei Schlüsseln. Ich muss die Arrays zusammenführen, die doppelte Werte haben, um die folgende Ausgabe zu erhalten.
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
)
)
Wie macht man das ? Ich habe versucht, array_merge & foreach Schleifen, aber ich kann diese Ausgabe nicht bekommen