Dynamic footer year
Had to make some updates to a website the other day that was made before we built sites using PHP includes which means i had to change at least 20 pages all becaude the footers date was wrong..!
Now these days when i’m building a website that needs a date in the footer i use a simple bit of PHP code which means you will never need to update it.
<?php echo date("Y"); ?>
And that is all the code you need to print the current year.
Written by Mike Ballan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Related Tags
#php
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#