php 초단위를 일/시간/분/초 단위로 변경하고자 할때
마스터욱
0
33
0
0
2018-08-05 12:51:32
- $total_time = 86400; //24시간은 86400초
- $time = $total_time - ( $days * 86400 );
- $time = $time - ( $hours * 3600 );
- $sec = $time - ( $min * 60 );
- $stay_time = "";
- if($days != 0) $stay_time .= $days."일 ";
- if($hours != 0) $stay_time .= $hours."시간 ";
- if($min != 0) $stay_time .= $min."분 ";
- $stay_time .= $sec."초 ";