Monday, 13 August 2018

Print A Current Copywrite Notice With PHP

One thing that is inexcusable on any website is printing a copywrite notice that is out of date. There are many protagonists of this crime and it is fairly easy to spot.
However, rather than go through all of the pages on your site and hand code in the copywrite notice you could just put in the following little bit of PHP.
Copyright  #! code
This will print off a current copywrite notice, no matter what the year is.
Copyright 2008 #! code
The date() function is built into PHP and takes two parameters. The first (required) parameter is a format string for the date. In this example we are giving a single capital "Y", which returns a numeric representation of the year with 4 digits.
The second parameter for the date() function is optional and is the timestamp that you would like to be formatted. If no timestamp is given then the current timestamp is used.

0 comments:

Post a Comment