I want to put a copyright notice in the footer of a web site, but I think it\'s incredibly tacky for the year to be outdated.
How would I make the year update automat
My way to show the copyright, That keeps on updating automatically
<p class="text-muted credit">Copyright ©
<?php
$copyYear = 2017; // Set your website start date
$curYear = date('Y'); // Keeps the second year updated
echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
?>
</p>
It will output the results as
copyright @ 2017 //if $copyYear is 2017
copyright @ 2017-201x //if $copyYear is not equal to Current Year.
<?php date_default_timezone_set("Asia/Kolkata");?><?=date("Y");?>
You can use this in footer sections to get dynamic copyright year