好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

php秒数怎么转换时长

$seconds = 3600*34 + 122;
function changeTimeType($seconds){
    if ($seconds > 3600){
   $hours = intval($seconds/3600);
   $minutes = $seconds % 3600;
   $time = $hours.":".gmstrftime('%M:%S', $minutes);
    }else{
   $time = gmstrftime('%H:%M:%S', $seconds);
    }
    return $time;
}
echo changeTimeType($seconds);

推荐学习:《PHP视频教程》

以上就是php秒数怎么转换时长的详细内容!

查看更多关于php秒数怎么转换时长的详细内容...

  阅读:39次