Created
October 21, 2013 20:18
-
-
Save LibertysYarn/7090246 to your computer and use it in GitHub Desktop.
Automatic Copyright Year - CSS-Tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
© <?php echo date("Y") ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function auto_copyright($year = 'auto'){ ?> | |
<?php if(intval($year) == 'auto'){ $year = date('Y'); } ?> | |
<?php if(intval($year) == date('Y')){ echo intval($year); } ?> | |
<?php if(intval($year) < date('Y')){ echo intval($year) . ' - ' . date('Y'); } ?> | |
<?php if(intval($year) > date('Y')){ echo date('Y'); } ?> | |
<?php } ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php auto_copyright(); // 2011?> | |
<?php auto_copyright('2010'); // 2010 - 2011 ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
© 2008-<?php echo date("Y") ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment