PHP 根据时间差得出时分秒
function secTime(int $time = 0){
if($time < 1) return '0秒';
$str = '';
if($time >= 3600){
$str .= floor($time / 3600) . '小时';
$time = $time % 3600;
}
if($time >= 60){
$str .= floor($time / 60) . '分钟';
$time = $time % 60;
}
if($time > 0){
$str .= $time . '秒';
}
return $str;
}