How to Add Year to Date in PHP?
Here, i will show you how to add year to date in php. i explained simply about how to add 5 years to current date in php. we will help you to give example of php add year to date. we will help you to give example of php add 1 year to current date.
I will give you very simple example how to add year to date in PHP. so let's see both example with output:
Example 1: PHP Add Year to Date
$date = "2022-02-01";
$newDate = date('Y-m-d', strtotime($date. ' + 5 years'));
Example 2: PHP Add Year to Current Date
$newDate = date('Y-m-d', strtotime(' + 5 years'));
i hope it can help you...
We are Recommending you
- How to Add Days to Date in PHP?
- PHP - How to Get File Name and Extension form URL?
- How to Find Number from String in PHP?
- How to Get HTML Tag Value in PHP?
- PHP Explode Every Character into Array Example
- PHP Copy File from One Folder to Another Example
- PHP Remove Directory and Files in Directory Example
- How to Check If a String Contains HTML Tags in PHP?
- How to Remove Null Values from Array in PHP?
- How to Merge Two Array with Same Keys without Loop in PHP?