Live Brilliant

일자 ( 잔여일 구하기 함수) 본문

개발은 핵찜이야/PHP

일자 ( 잔여일 구하기 함수)

주인정 2012. 4. 13. 16:48
php 잔여일 구하기 함수

echo date_cnt("2012-01-01","2012-01-10");

function date_cnt($frDate,$toDate) {
$difTime = mktime(0,0,0,substr($toDate,5,2),substr($toDate,8,2),substr($toDate,0,4)) - mktime(0,0,0,substr($frDate,5,2),substr($frDate,8,2),substr($frDate,0,4));
return $difTime/86400;
}

 

Comments