Return to Snippet

Revision: 63373
at May 2, 2013 01:34 by scorpayllc


Initial Code
&copy; <?php echo date("Y") ?>

&copy; 2008-<?php echo date("Y") ?>

<?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 } ?>

<?php auto_copyright(); // 2011?>

<?php auto_copyright('2010');  // 2010 - 2011 ?>

Initial URL

                                

Initial Description

                                

Initial Title
Automatic Copyright Year | CSS-Tricks

Initial Tags

                                

Initial Language
PHP