how many days remain from some date using php.
//get number of days remaining from some date
$inpDate = "2010-06-06";
list($inpYear, $inpMonth, $inpDay) = split("[./-]", $inpDate);
$numOfDaysRemaining = ceil((mktime(0,0,0,$inpMonth, $inpDay, $inpYear) - time())/86400);
echo "Num of days remaining:".$numOfDaysRemaining;
//Similarly how many days remain from current date can also be found by setting current date to $inpDate variable
?>
No comments:
Post a Comment