Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <?php
  2. function auto_copyright($year = 'auto'){
  3. if(intval($year) == 'auto'){
  4. $year = date('Y');
  5. }
  6. if(intval($year) == date('Y')){
  7. echo intval($year);
  8. }
  9. if(intval($year) < date('Y')){
  10. echo intval($year) . ' - ' . date('Y');
  11. }
  12. if(intval($year) > date('Y')){
  13. echo date('Y');
  14. }
  15. }
  16. ?>
  17. <?php auto_copyright(); // 2011?>
  18. <?php auto_copyright('2010'); // 2010 - 2011 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement