How to Get the Current Year using PHP
date()
You can simply use the PHP date() function to get the current year.
The following example code will be very useful if you want to put a copyright notice in a website footer without worrying about changing it every year.
<p>Copyright © <?php echo date("Y"); ?> MyWebsite. All Rights Reserved.</p>
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Use the PHP
date()FunctionYou can simply use the PHP
date()function to get the current year.The following example code will be very useful if you want to put a copyright notice in a website footer without worrying about changing it every year.
need an explanation for this answer? contact us directly to get an explanation for this answer