In this tutorial, we will explain to you how to add days to current date in PHP. if you want to add days to the current date then you can easily add days using PHP. so you can see our following example.
Add days to current date php
If you want to add days to current date then you can see the following example. here we use the date() function and strtotime() function for getting the current date and date convert into Unix timestamp. The following example code will add 7 days to current date.
Example
<?php echo date('Y-m-d', strtotime(' + 7 days')); ?>
Add days to specific date php
If you want to add days to a specific date then you can see the following example. The following example code will add 7 days to specific date.
Example
<?php $date = "2021-08-10"; echo date('Y-m-d', strtotime($date. ' + 7 days')); ?>
Output
2021-08-17
Please follow and like us: