Happy New Year!

I’d like to take this opportunity to wish you all a very happy new year. I won’t look back at the past year or the past decade and try to list any spectacular events or lessons from that time period (I don’t have a good enough memory to do that), nor will I try to look forward and make any predictions about what’s going to happen in the coming decade or even the coming year.

Instead, I’m going to take this opportunity to share a very quick, easy tip for anyone using a PHP template on their Web sites to ensure that your copyright always shows the current year, doing a very small part to keep your site from looking too terribly out of date.

All you need is the PHP date() function. If you just want to show the current year in your copyright notice, you can do something like:

&copy;<?php echo date("Y"); ?> Your Company Name

You might even want to keep the date on which your site was initially created within the copyright notice. That’s simple, too. In fact, the PHP doesn’t change at all, you’ll just add a little extra text to the beginning.

&copy;1996-<?php echo date("Y"); ?> Your Company Name

You can insert this code into any PHP file to display the current year as your copyright date. Of course, if your Web site was not founded in 1996, you’ll want to change that to the appropriate year. No matter what happens, your Web site copyright notice will always show the current year.

Enjoy the new year, and thank you for your support over the last decade or so. Let’s hope we can keep this going for at least another decade.

Did you like this post? Get monthly summary of our new tutorials, posts and tips to your inbox!

One Response

  • Allen

    happy new year to you too curtiss! i just updated the HTMLC footer :-P

Post Your Comment

Your email address will not be published.