I have an array with this structure:
[
{
"id": "2644688"
},
{
"id": "2644689"
}
]
I'm trying to reverse it using array_reverse
:
$reversed = array_reverse($result, true);
return $response->withJson($reversed);
but I get:
{
"0": {
"id": "2644688"
},
"1": {
"id": "2644689"
}
}
the order is the same, the function array_reverse
just added the numerical indexes, I did something wrong?