php
php 현재날짜 및 7일 후 날짜, 날짜 비교
xemaker
2018. 12. 31. 07:43
php 현재날짜
$today=date("Ymd");
출력결과형태: 20181231
20181201
오늘 부터 7일 후
$timestamp=strtotime("+7 days");;
$today7=date("Ymd",$timestamp);
날짜비교
strtotime을 사용한다.
$calday=$dayArray["year"].$dayArray["mon"].$dayArray["mday"];
if(strtotime($today7)>strtotime($calday)){
}else{
}