Php – How to add day,month,year with current date

## ADD DAYS, MONTHS, YEAR WITH CURRENT MONTHS::
 
FORMAT:: date('Y-m-d', strtotime('+2 months'));

EXAMPLE::
$duration = 5;
 
if($calas == "days")
{
    $plus = '+'.$duration.' days';
}
else if($calas == "months")
{
    $plus = '+'.$duration.' months';
}
else if($calas == "years")
{
    $plus = '+'.$duration.' years';
}

echo date('Y-m-d', strtotime($plus));
Please follow and like us:
0