Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function auto_copyright($year = 'auto'){
- if(intval($year) == 'auto'){
- $year = date('Y');
- }
- if(intval($year) == date('Y')){
- echo intval($year);
- }
- if(intval($year) < date('Y')){
- echo intval($year) . ' - ' . date('Y');
- }
- if(intval($year) > date('Y')){
- echo date('Y');
- }
- }
- ?>
- <?php auto_copyright(); // 2011?>
- <?php auto_copyright('2010'); // 2010 - 2011 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement