In PHP given a UTC timestamp I would like to add exactly N number of years. This should take into consideration leap years.
Thank you.
One thing you should consider when you do this.
$newTimestamp = strtotime('+2 years', $timestamp);
This adds up 2 years ( 720 or 721 days). In case you just want to keep the same day and month and add 2 extra years in the timestamp
you have to use mktime.
Example
$timestamp = mktime(0, 0, 0, $month, $day, $year+2);`
Replace "+2 years" as required.
ref: http://php.net/manual/en/function.strtotime.php