datetime add days php code example
Example 1: php date plus days
<?php
$date = "2019-05-10";
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?>
Example 2: 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 3: how to add extra days from a date php
<?php
$date = date('Y M d h:i:s')
$new_date = Carbon::parse($date->addDays(1);
$date = date('Y M d h:i:s')
echo $new_date = date('Y M d h:i:s', strtotime($date. '+1 day'));
?>
Example 4: Add days to date in PHP
$date = new DateTime('2020-11-24');
$date->add(new DateInterval("P9D"));
echo $date->format('Y-m-d');
Example 5: add 1 day php datetime
$date = new DateTime('2000-01-01');
$date->add(new DateInterval('P1D'));