I want to find the time
and temp
in the row with maximum temp
value in a 2d array.
Here is sample data for my weather array:
[
['time' => '00:00', 'temp' => '15.1'],
['time' => '00:00', 'temp' => '15.1'],
['time' => '00:01', 'temp' => '15.1'],
['time' => '00:02', 'temp' => '15.1'],
['time' => '00:02', 'temp' => '15.1'],
['time' => '00:02', 'temp' => '15.0'],
['time' => '00:03', 'temp' => '15.0'],
]
I've tried a few google searches and it finds the max temp, but I cannot work out how to get the time associated with that.
This is also using WordPress, so I am trying to reduce the WP_Queries I have setup currently.