Source Code:
(back to article)
<?php //apply DateTime. $currentDate = new DateTime(); //Get the year by using the format method. $year = $currentDate->format("Y"); //Printing that out echo $year; ?>
Result:
Report an issue