Answers for "php print year copyright"

PHP
2

automatic years php

&copy; <?php echo date("Y"); ?>
Posted by: Guest on April-26-2020
0

php copyright footer

© <?php echo date("Y"); ?> Copyright.
Posted by: Guest on August-18-2020
0

automatic years php

<?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 - 2017 ?>
Posted by: Guest on April-26-2020

Browse Popular Code Answers by Language