Member
jasen_gottlieb
How to get next year in PHP?
ryan.murray
@jasen_gottlieb use DateTime() object to get next year in PHP, code:
1 2 3 4 5 6 7 8
<?php $nextYear = new DateTime("+1 year"); // Output: 2023 echo $nextYear->format("Y"); // Output: 23 echo $nextYear->format("y");