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
Did you know?
PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#