Perpetual Copyright

Posted on June 12th, 2008 by dandavis
Tags:

Seen this a few times while stumbling. I've been doing it myself for quite a while now, but…

Put this code in the footer of your pages:
<?php
$copyright = '2005'; $year = date('Y');
if ($year > $copyright) { $copyright .= '-'.$year; }
echo 'Copyright &copy; ',$copyright,' Me';
?>

Produces:

Copyright © 2005-2008 Me

And, as other sites are keen on pointing out, on January 1st of the new year, your copyright text will automatically update… So, January 1st, 2009, the code about will print out:

Copyright © 2005-2009 Me

Etc, etc.

Post a comment

You must be logged in to post a comment.