Answers for "how to get current year -1 in php"

PHP
8

php get current year

// get current year using php
<?php echo date("Y"); ?>
Posted by: Guest on August-03-2020
2

php date + 1 year

$today =date('Y-m-d');
$expiryDate=date('Y-m-d H:i:s', strtotime('+1 year', strtotime($today)) );
Posted by: Guest on February-23-2022

Browse Popular Code Answers by Language