我有如下数组:
array
(
[0] => 505:25:32
[1] => 480:00:01
[2] => 504:00:01
[3] => 480:00:02
)
我想添加它并获得总时间h:i:s
。我想过把这个数组分成三个
hour_array(
[0] => 505
[1] => 480
[2] => 504
[3] => 480
)
min_array(
[0] => 25
[1] => 00
[2] => 00
[3] => 00
)
sec_array(
[0] =>32
[1] => 01
[2] => 01
[3] => 02
)
然后单独添加每个数组,然后对它们求和。但是这个解决方案似乎有点冗长,还有另一个解决方案