Fancy displaying the current year and avoid having to update your copyright every year? It's really simple.
<?php echo date("Y"); ?>
<?= date('Y') ?> (This requires PHP 5.4+)
© <?php echo date("Y"); ?> - All rights reserved.
© <?php $copyYear = 2013; $curYear = date('Y'); echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : ''); ?> My Company.
This article applies to the following:
- PHP: Hypertext Preprocessor - Server-side HTML embedded scripting language. It provides web developers with a full suite of tools for building dynamic websites: native APIs to Apache.
Article incorrect or outdated? Do let us know →
Updated 18/01/14 @ 08:55 PM
Daniel D, Editor