Fri 8th May 2009
|
If you have your own website then the chances are you have a footer containing a copyright notice and a date.
While this is all fine and dandy in itself, when was the last time you checked the date? Even if you often update your website it's very often something that gets overlooked.
While this isn't a problem in itself, it does a look a little bad when in the year 2009 your copyright notice is stating 2004 for example.
You could of course put a note in your diary to change the date on your website on the 1st of January every year but having it done automatically is going to be the best option.
So, how do you achieve this? Simple! By using PHP. Simply stick the following code in your PHP enabled page:
<?php echo date('Y'); ?>
This will print out the current year - every year it updates automatically. Hoorah!
Check out the official PHP Date page at php.net for more information and further usage examples. |
|
|