How to Automatically Add the Current Year in PHP
Happy New Year. In this lesson we cover how to automatically add the current year to your copyright. Quite appropriate for today!
The magic of using a server-side language like PHP is that we can automate many processes.
At this time of year, I can imagine that many sites will have the incorrect year displayed in their copyright message, especially if they are standard HTML sites.
Using a simple line of PHP code we can automatically add the copyright year.
<div> © 2015 Coding Academy </div>
<div> © <?php echo date("Y") ?> Coding Academy </div>
Want to Learn More?
Become a member and get access to the member only area of this site.LEARN MORE
Your email address will not be published.
PHP for Beginners
FREE Code Snippets
FREE hints and tips delivered direct to you once per month.