php

How to get the current year in PHP

In this tutorial, we are going to see how to get the current year in PHP. You can simply use the PHP date() function to get the current year. As shown in the following example:
 

How to get the current year in PHP
<p>Copyright 
    <?php echo date("Y"); ?> 
StackHowTo.com. All rights reserved.</p>

Output:

Copyright 2022 StackHowTo.com. All rights reserved.
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *