醉菜鸟 2022-01-12 08:00:24

php字符串时分秒转换为秒数

function format_transform($time){
    $duration  = explode(":",$time);
    $duration_in_seconds = $duration[0]*3600 + $duration[1]*60+ round($duration[2]);
    return $duration_in_seconds;
}
意见反馈