how to add date with dynamic days in php code example
Example 1: php date strtotime add days
$n = date('Y-m-d', strtotime( $d . " +1 days"));
$n = date('Y-m-d', strtotime( $d . " +1 month"));
$n = date('Y-m-d', strtotime( $d . " +1 year"));
$n = date('Y-m-d', strtotime( $d . " -1 days"));
$n = date('Y-m-d', strtotime( $d . " -1 month"));
$n = date('Y-m-d', strtotime( $d . " -1 year"));
Example 2: Add days to date in PHP
$date = new DateTime('2020-11-24');
$date->add(new DateInterval("P9D"));
echo $date->format('Y-m-d');