Adding days to a date in PHP
Here is the small and most useful function to add days to a particular date.
function dayadd($g,$dayYmd) {
//add $g days to $dayYmd (date is in YYYY-MM-DD format)
$d = strtotime($dayYmd);
$cc = 24*60*60*$g + 60*60 + $d;
return date("Y-m-d",$cc);
}
?>
Labels: adding days to date php, date php, php
posted by adityachandra @ 12:29 PM,
Post a Comment