Auto updating copyright (PHP)


SUBMITTED BY: scripts4you

DATE: Oct. 21, 2015, 8:57 a.m.

FORMAT: Text only

SIZE: 381 Bytes

HITS: 1816

  1. function autoUpdatingCopyright($startYear){
  2. // given start year (e.g. 2004)
  3. $startYear = intval($startYear);
  4. // current year (e.g. 2007)
  5. $year = intval(date('Y'));
  6. // is the current year greater than the
  7. // given start year?
  8. if ($year > $startYear)
  9. return $startYear .'-'. $year;
  10. else
  11. return $startYear;
  12. }

comments powered by Disqus