Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $time = array (
- '2452:43:44',
- '452:43:44',
- '242:43:44',
- '252:43:44',
- '2:43:44'
- );
- $seconds = 0;
- foreach($time as $hours) {
- $exp = explode(':', strval($hours));
- $seconds += $exp[0]*60*60 + $exp[1]*60 + $exp[2];
- }
- $average = $seconds/sizeof( $time );
- echo floor($average/3600).':'.floor(($average%3600)/60).':'.($average%3600)%60;
Add Comment
Please, Sign In to add comment