Display Only Current Year With PHP

Display Year With PHP

For many who maintain web sites, even on the personal level, the change of year requires updates to pages that have the year displayed on them . Web designers who have content managers running there sites already have this issue already covered in that the content manager is already running a server side script of PHP, ASP, Perl or other that updates the displayed year.

Many web site designers, for example, have to update the copyright year displayed on their own websites, and similarly on their client’s websites. Unfortunately, many end up doing the update manually and waste a lot of time with this tedious task, but many others use a better method, and it’s as simple as single line of PHP.

Copyright <? print(Date(“Y”)); ?>

Add this simple line of php code anywhere the year needs to be displayed and no longer will you have to manually edit the footer of your websites, or other pages, with each new year that passes.

Another use of the single line of code is in META tag that uses a year, such as the copyright content meta tag :

<META NAME=”copyright” CONTENT=”Copyright ©<? print(Date(“Y”)); ?>” />

The above works really well. I wish I had done this sooner as I have so many pages on one of my sites that I have the meta copyright tad included.


Share
 ______________________________________________________

A useful way to provide remote support to computer users anywhere in the world. The usefulness of remote control support has inevitably brought about quick and customer satisfying computer desktop and server support. End-users and administrators of servers, cloud computing, virtual infrastructure and other services have all benefited from remote support and it’s instrumental in keeping users productive in all sorts of environments.

Advertisements