我有一系列时间如下:
Array
(
[0] => 00:00:04
[1] => 00:00:05
[2] => 00:00:02
[3] => 00:00:09
[4] => 00:00:03
[]...
)
我正在尝试使用以下代码计算平均时间:
foreach($times as $t) {
$unixtime += strtotime($t);
}
$unixtime = $unixtime / count($times);
echo "Unix Time: " . $unixtime . "<br />";
echo "Formatted: " . date("h:i:s",$unixtime) . "<p/>";
但我得到的输出是:
Unix 时间:1345669204.37 格式:12:00:04
谁能告诉我我做错了什么?