PHP average time from an array

后端 未结 4 527
逝去的感伤
逝去的感伤 2021-01-18 18:48

How do I work out the average time from an array of times.

I have an array that looks like this :

(\'17:29:53\',\'16:00:32\')

And I

4条回答
  •  误落风尘
    2021-01-18 19:27

    date('H:i:s', array_sum(array_map('strtotime', $array)) / count($array))
    

    Untested solution typed on my phone, should work though.

提交回复
热议问题