Tag: time


Making a Dynamic Copyright With PHP

I though I'd just write a quick tutorial on how I make a dynamic copyright for my websites. If you don't know what a function does in the code, look it up on the PHP manual.

<?php echo strftime('%Y', time()); ?>

That's the year generating code. It's just grabbing the year from the current timestamp. So we could do something like this in the copyright:

&copy; <?php echo strftime('%Y', time()); ?> Legion of Weirdos.

You might want to wrap around the code in a helper function:

Read more