PHP function to display current year
If your web site has copyright footer and you want it to
display current year, you can use PHP date function to make year
current. For example, the follow lines of code will display owner’s
copyright notice from 2002 to current year (2007):
Tags: PHP
<STYLE TYPE="text/css"
MEDIA=screen>
<!--
.Footnote
{
font-family: Arial, Helvetica, Sans-Serif;
font-size: 11px;
color: #999999;
}
-->
</STYLE>
<p align=center><font class="Footnote">©
2002-<?php echo date('Y');
?> Web Designed by
<a href="http://www.innovitainc.com">
<img src="/images/InnoVitalogo1.jpg" valign="TOP" border="0"
height="14" width="18"><b>
<i><font
color="red">Inno</font><font
color="green">Vita</font></i><font
color="blue">
Inc.</font></b>.</a> All
rights reserved.</font></p>
CJ said,
April 29, 2007 @ 6:56 pm
Hiya,
Just wanted say cheers !!! I looked on the PHP site and as usual it went on about a load of codsh?t with like 15 lines of code, ALL I WANTED WAS “” !!!!
Cheers again, thanks to the big G your site has made it into my bookmarks ;-)
Regards
Adam Kayce said,
July 25, 2008 @ 1:10 pm
By the way, if someone who doesn’t really know what they’re doing copies the code you have for the ‘year’ piece, they’re going to be in for a surprise…
The first apostrophe is curly; the second one is straight (you’d want them both straight). Like this: (‘Y’)
Thanks!
Harish said,
August 2, 2008 @ 12:52 pm
Thanks. Would visit your website again to read if there is anything more that I can use.
SAND said,
August 27, 2008 @ 12:16 am
http://www.gmail.com
Peter said,
February 22, 2009 @ 8:19 am
Hi
This is a great little tutorial for automatic update of year display, but like the above poster please correct the mistake with the ‘y’
Thanks for this
Peter