Dynamic Copyright Date
Tutorial Category: PHP
Tired of changing the copyright date in the footer of your website? With this tutorial, you’ll learn how to use php code to display the current date automatically!
Place the following code where you want the year to display:
<?php echo date('Y'); ?>
The result will be the current 4 digit year. If you prefer a two digit year instead, use the following:
<?php echo date('y'); ?>
An example of a copyright text line would be:
Copyright © <?php echo date('Y'); ?> Your Website Name, All Rights Reserved.