Currently I have this json data
1st Data
{
"id": 41,
"userId": 9,
"description": null,
"updated_by": "Juan Dela Cruz",
"created_at": "2019-09-18 10:07:34",
"updated_at": "2019-09-18 10:07:34"
}
2nd Data
{
"id": 2,
"userId": 9,
"description": null,
"updated_by": null,
"created_at": "2019-09-16 12:46:56",
"updated_at": "2019-09-16 12:46:56"
}
I have this variable $myData
if you try to echo this $myData
the above json will be the expected output.
Is it possible to get the most recent created_at
using this max()
function of php?
My expected output would be
1st Data
{
"id": 41,
"userId": 9,
"description": null,
"updated_by": "Juan Dela Cruz",
"created_at": "2019-09-18 10:07:34",
"updated_at": "2019-09-18 10:07:34"
}
Since the created_at
is recently created than to the 2nd data.