<?php// PHP program to add days to $Date // Declare a date $date="2019-05-10";// Add days to date and display it echodate('Y-m-d',strtotime($date.' + 10 days'));?>
<?php$date="2022-08-12";// Add days to date and display it echodate('Y-m-d',strtotime($date.' +10 days'));// 2022-08-22echodate('Y-m-d',strtotime(date('Y-m-d').' +1 days'));// 2022-08-23echodate('Y-m-d',strtotime(date('Y-m-d').' +1 months'));// 2022-09-12echodate('Y-m-d',strtotime(date('Y-m-d').' +1 year'));// 2023-08-12?>
<?php// adding extra days to date // Steps:// 1) using carbon// 2) using strtotime//Step 1$date=date('Y M d h:i:s')// 2020 09 22 22:09:26 UTC$new_date=Carbon::parse($date->addDays(1);// adds extra day// Step 2$date=date('Y M d h:i:s')// 2020 09 22 22:09:26 UTCecho$new_date=date('Y M d h:i:s',strtotime($date.'+1 day'));?>