"The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents." — Nathaniel Borenstein

Never Update Your Copyright Again!

Never Update Your Copyright Again!

Recently, I was reading an article on Smashing Magazine called…”Don’t Forget The Small Stuff This Year“, and within that article it reminded users to update their copyright statement each new year!

Have you ever forgotten to update your copyright statement to 2010? I know I have, however; let’s make sure that doesn’t happen again. With this short PHP code snippet, your statement will automatically update! How cool is that?

                                        <p><strong>&copy; Copyright 2010 <a href="/">The Web Squeeze, LLC.</a> All Rights Reserved.</strong></p>
                                        

We’re going to change the above to…

                                        <p><strong>&copy; Copyright < ?php echo date('Y'); ?> <a href="/">The Web Squeeze, LLC.</a> All Rights Reserved.</strong></p>
                                        

The key in the above code is this line…

                                        < ?php echo date('Y'); ?>
                                        

The above line of code is using PHP’s built in date function. We’re saying echo out the current year (Y) in a 4 digit format. (e.g. 2010) If you’ve never used the date function, or want to customize the above a bit further, check out the date function.

http://us2.php.net/manual/en/function.date.php

I hope this helps make your life just a tad easier!

Comments are closed.