fork(2) download
  1. <?php
  2.  
  3. $times = array('24:10','8:25','6:45','7:05','7:00','0:30');
  4.  
  5. $seconds = 0;
  6.  
  7. foreach ( $times as $time )
  8. {
  9. list( $g, $i ) = explode( ':', $time );
  10. $seconds += $g * 3600;
  11. $seconds += $i * 60;
  12. }
  13.  
  14. $hours = floor( $seconds / 3600 );
  15. $seconds -= $hours * 3600;
  16. $minutes = floor( $seconds / 60 );
  17.  
  18. echo "{$hours}:{$minutes}";
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
53:55