Array 1
array(1) {
[0]=>
array(3) {
["shoplist_id"]=>
int(11)
["shoplist_name"]=>
string(18) "PM_Mon_Wed_Fri_Sun"
["shoplist_status"]=>
int(0)
}
}
Array 2
array(3) {
[2184]=>
array(3) {
["shoplist_id"]=>
int(11)
["shoplistshop_id"]=>
int(7)
["shoplistshop_status"]=>
int(0)
}
[2184]=>
array(3) {
["shoplist_id"]=>
int(11)
["shoplistshop_id"]=>
int(8)
["shoplistshop_status"]=>
int(0)
}
}
[2185]=>
array(3) {
["shoplist_id"]=>
int(11)
["shoplistshop_id"]=>
int(9)
["shoplistshop_status"]=>
int(0)
}
}
What I want
array(2) {
[0]=>
array(3) {
["shoplist_id"]=>
int(11)
["shoplist_name"]=>
string(18) "PM_Mon_Wed_Fri_Sun"
["shoplist_status"]=>
int(0)
array(3) {
[0]=>
array(2) {
["shoplistshop_id"]=>
int(7)
["shoplistshop_status"]=>
int(0)
}
[1]=>
array(2) {
["shoplistshop_id"]=>
int(8)
["shoplistshop_status"]=>
int(0)
}
[2]=>
array(2) {
["shoplistshop_id"]=>
int(9)
["shoplistshop_status"]=>
int(0)
}
}
}
}
Primary key is shoplist_id.
I need to merge array 1 and array 2 since they have both the same key and value.
I tried to use array_merge / array_merge_recursive seems like not working.
So how can I merge array 1 and 2 with the same key and same value? Is that anything I miss? Much thanks.