Skip to content
Advertisement

Get results with latest date in foreach loop in php?

I have a array : $data .

And this is the result when I dd($data)

JavaScript

In controller :

JavaScript

Result :

JavaScript

In my array. I have two order = 3. I just want to get an array with order = 3 and have the latest time. For example, I want to get an array with order = 3 and createAt = '2021-09-24T03:29:37.000Z'

Advertisement

Answer

try this solution it will help

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement