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

MatrixNinja picture MatrixNinja · Aug 9, 2013 · Viewed 12.7k times · Source

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?

Answer

6opko picture 6opko · Aug 9, 2013

It should be

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