LaravelPHP

How to add days in the current date in PHP?

If you want to add days in current date then simply get a date in PHP with the date(); function, The date() function formats a local date and time, and returns the formatted date string.

Syntax

date(format, timestamp)
<?php 
// PHP program to add days to $Date 
  
// Declare a date 
$Date = "2019-05-10"; 
  
// Add days to date and display it 
echo date('Y-m-d', strtotime($Date. ' + 10 days')); 
  
?>

output:

Output:

2019-05-20

Related Articles

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button