用PHP更新版权日期

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用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>

以上是关于用PHP更新版权日期的主要内容,如果未能解决你的问题,请参考以下文章

php 版权当前年代片段

PHP PHP版权日期

超实用的php代码片段

PHP版权日期

PHP 简单的开始和结束版权日期

text 更新网站页脚版权日期