Search code examples
phpdatemktime

Better way of creating a PHP future date


Is there a quicker way of creating a date such as:

echo date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")+3,   date("Y")));

Thanks if you can help.


Solution

  • How about strtotime():

    date('Y-m-d', strtotime('+3 days'));