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
$times = array('17:29:53','16:00:32');
$totaltime = '';
foreach($times as $time){
$timestamp = strtotime($time);
$totaltime += $timestamp;
}
$average_time = ($totaltime/count($times));
echo date('H:i:s',$average_time);
date('H:i:s', array_sum(array_map('strtotime', $array)) / count($array))
Untested solution typed on my phone, should work though.