How to Add Days to Date in PHP?
This article goes into detail on how to add days to date in PHP. step by step explain how to add days to the current date in PHP. it's a simple example of how to add 7 days to date in PHP. This article goes into detail on how to add 30 days to date in PHP. Alright, let’s dive into the steps.
I will give you very simple example how to add days to date in PHP. so let's see both example with output:
Example 1: PHP Add Days to Date
$date = "2021-11-01";
$newDate = date('Y-m-d', strtotime($date. ' + 3 days'));
Example 2: PHP Add Days to Current Date
$newDate = date('Y-m-d', strtotime(' + 3 days'));
i hope it can help you...
We are Recommending you
- How to Extract All Email Addresses from String in PHP?
- How to get HTML Tag Attribute Value in PHP?
- Moment JS Get Year from Date Example
- JQuery Moment Get Current Date Example
- Laravel Carbon Check Date is in Past Date Code
- How to Change Date Format in PHP?
- PHP MySQL Column Sorting Example Tutorial
- PHP Check Word Exist in String or Not Example
- How to Find Day Name from Specific Date in PHP?