PHP Subtract Year from Date Example
In this article we will cover on how to implement how to subtract year to date in php. This article goes in detailed on how to sub year to current date in php. step by step explain how to sub 5 years to date in php. you can understand a concept of how to sub 10 years to date in php.
I will give you very simple example how to subtract years to date in PHP. so let's see both example with output:
Example 1: PHP Subtract Year to Date
$date = "2021-11-01";
$newDate = date('Y-m-d', strtotime($date. ' - 3 years'));
Example 2: PHP Subtract Year to Current Date
$newDate = date('Y-m-d', strtotime(' - 3 years'));
i hope it can help you...