//2 つの期間の長さを計算する public function GetTimeLong($time1,$time2,$format="i"){ $length = abs($time2 - $time1); if($format=="d " ){ $long = $this->GetFormatOne($length/86400)."day"; }elseif ($format=="h"){ $long = $this->GetFormatOne($length/3600) . "時間"; }elseif ($format=="i"){ } $long = $this->GetFormatOne($length/60)."分"; }else{ $long = $length."秒" ; } return $long;}//小数点以下 1 桁を保持 function GetFormatOne($num){ $result = $format_num = sprintf("%.1f",$num); return $result;}