I have an array in php,
array(7) {
[0]=>
array(3) {
["idu"]=>
int(4830)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(4)
}
[1]=>
array(3) {
["idu"]=>
int(4831)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(4)
}
[2]=>
array(3) {
["idu"]=>
int(4831)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(5)
}
[3]=>
array(3) {
["idu"]=>
int(4920)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(4)
}
[4]=>
array(3) {
["idu"]=>
int(4920)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(5)
}
[5]=>
array(3) {
["idu"]=>
int(4919)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(4)
}
[6]=>
array(3) {
["idu"]=>
int(4918)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
int(4)
}
}
parameters like 'idu' and 'day' can be duplicated, but 'idu', 'day', 'type' cannot.
How to make the 'type' parameter combined for identical values for 'idu' and 'day'
e.g. for 'idu'=4831 and 'day'='2023-10-21 16:00:00' the 'type' parameter has values 4 and 5,
I would like these two items to become one in the form
...
array(3) {
["idu"]=>
int(4830)
["day"]=>
string(19) "2023-10-21 16:00:00"
["type"]=>
array(2) {
[0]=>int(4)
[1]=>int(5)
}
}
...
'idu'=4831why does the resulting item have'idu'=4830?