1)
function foo($seconds) {
$t = round($seconds);
return sprintf('%02d:%02d:%02d', ($t/3600),($t/60%60), $t%60);
}
echo foo('290.52262423327'), "
";
echo foo('9290.52262423327'), "
";
echo foo(86400+120+6), "
";
prints
00:04:51
02:34:51
24:02:06
2)
echo round($time, 2);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…