Search code examples
phpdynamicfootercopyright-display

how do I make a php footer dynamic copyright starting this year?


Here's my copyright as of right now:

<i>Example.com</i> &copy; 2013 - <?php echo date('Y'); ?>

this is okay next year because it will read:

Example.com © 2013 - 2014

but this year it says: © 2013-2013

How can I make it © 2013 and auto switch to © 2013-2014 next year, without having to come back and change it by hand?


Solution

  • It should be

    <i>Example.com</i> &copy; 2013 <?php (date('Y') !== "2013") echo "- " . date('Y')); ?>