PHP Dynamic Copyright Date – Echo the Year

Just a short update today – a way to dynamically output the year with PHP, so your site always stays updated! One less thing to worry about. This will output in a format, say “© 2010 – 2012 My awesome company.”

<?php
echo "&copy;";
$startYear = 2012;  
$currentYear = date('Y');  
echo $startYear . (($startYear != $currentYear) ? '-' . $currentYear : ''); 
echo " Your Company, Inc, LLC, GmbH, LTD, ... you get the drift.";
?>
Posted in PHP