//Kira panjang dua tempoh masa fungsi awam GetTimeLong($time1,$time2,$format="i"){ $length = abs($time2 - $time1 if($format=="d")); { $long = $this->GetFormatOne($length/86400)."hari" }elseif ($format=="h"){ $long = $this->GetFormatOne($length/3600)." jam "; }elseif ($format="i"){ } $long = $this->GetFormatOne($length/60)."Minit"; }else{ $long = $length."Detik"; } pulangkan $ panjang;}//Kekalkan satu fungsi tempat perpuluhan GetFormatOne($num){ $result = $format_num = sprintf("%.1f",$num);