I'm student, i have this array:
{
"user": "DAV",
"checks": [
{
"result": "OKEY",
"idCheck": 13,
},
{
"result": "1",
"idCheck": 14,
}
]
},
{
"user": "DAV",
"checks": [
{
"result": "X",
"idCheck": 14,
},
{
"idCheck": 13,
"result": null
}
]
}
Okey, thats my array, i want to order the "check" by the idCheck, because the second check, first id is 14 and the the seconds is 13. I dont know what i have to do. Maybe usort or something. I don't know
The result i want is this:
{
"user": "DAV",
"checks": [
{
"result": "OKEY",
"idCheck": 13,
},
{
"result": "1",
"idCheck": 14,
}
]
},
{
"user": "DAV",
"checks": [
{
"result": null,
"idCheck": 13,
},
{
"idCheck": 14,
"result": X
}
]
}
Thanks.
The solution is: