분류
php
두 날짜 간의 일 계산
본문
$start_date
=
strtotime
(
'2018-08-11'
);
$end_date
=
strtotime
(
'2018-08-31'
);
echo
$days_difference
=
ceil
(
abs
(
$end_date
-
$start_date
) / (60 * 60 * 24));
/*
Output : 20
*/
- 이전글PHP : 날짜가 오늘, 과거 또는 내일인지 확인 18.08.31
- 다음글PHP : 문자열에 특정 단어가 포함되어 있는지 확인 18.08.31