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

0 0 vote
Article Rating

Subscribe
Notify of
guest
1 Comment
oldest
newest most voted
Inline Feedbacks
View all comments
grandbracelets.co.uk
11 months ago

Greetings! Very useful advice within this article! It’s the little changes which will make the greatest changes.
Many thanks for sharing!

1
0
Would love your thoughts, please comment.x
()
x