How to Add days in a Date in PHP?
In this tutorial, we will learn How to add days to a Date in PHP. I will give you two examples to add days to a date.
Example 1: If you to add days to a specific date
1 2 3 4 5 |
<?php $date = "2022-01-10"; $newDate = date('Y-m-d', strtotime($date. ' + 5 days')); echo $newDate; ?> |
Output: 2022-01-15
Example 2: If you to add days to a Current Date
1 2 3 4 |
<?php $newDate = date('Y-m-d', strtotime(' + 5 days')); echo $newDate; ?> |