Filter an object by date with php

Viewed 15

I have the following object in php, which is returned from a database query, I know I could pass these date parameters in the query but it won't supply me, I need to filter the object not the query.

accomplished:
[
{
    "id": 280777,
    "collaborator_id": 834,
    "task_id": 4079,
    "created_at": "2022-04-19 17:16:57",
    "updated_at": "2022-04-19 17:16:57",
    "value": "0.00",
    "qtValue": null,
    "clientName": null,
    "clientPhone": null,
    "prospect_id": null,
    "comments": null,
    "latitude": null,
    "longitude": null
},
{
    "id": 280778,
    "collaborator_id": 834,
    "task_id": 4079,
    "created_at": "2022-04-19 17:17:00",
    "updated_at": "2022-04-19 17:17:00",
    "value": "0.00",
    "qtValue": null,
    "clientName": null,
    "clientPhone": null,
    "prospect_id": null,
    "comments": null,
    "latitude": null,
    "longitude": null
},
{
    "id": 283212,
    "collaborator_id": 834,
    "task_id": 4080,
    "created_at": "2022-05-04 17:57:58",
    "updated_at": "2022-05-04 17:57:58",
    "value": "0.00",
    "qtValue": null,
    "clientName": null,
    "clientPhone": null,
    "prospect_id": null,
    "comments": null,
    "latitude": null,
    "longitude": null
}
]

I would like to filter this object by date, for example, return objects that are between the date 2022-04-01 and 2022-04-30.

0 Answers
Related