Posted By

1man on 04/25/07


Tagged

year copyright update footer


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

willbolton
ericborgen
vali29
jonhenshaw


Update Copyright Date in PHP


 / Published in: PHP
 

Way to update the footer of a website automatically on 1st Jan.

  1. <div id="footer">
  2. <p>&copy;
  3. <?php
  4. ini_set('date.timezone', 'Europe/London');
  5. $startYear = '2006';
  6. $thisYear = date('Y');
  7. if($startYear == $thisYear){
  8. echo $startYear;
  9. } else {
  10. echo $startYear.' &ndash '.$thisYear;
  11. }
  12. ?>
  13. Company Name Here</p>
  14. </div>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: jonhenshaw on April 26, 2007

Here's another way to do it -- something I posted a while back.

Automatic Date for Footer

Posted By: jonhenshaw on April 26, 2007

http://snipplr.com/view/1394/automatic-date-for-footer/

You need to login to post a comment.