PHP 自动更新版权声明

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP 自动更新版权声明相关的知识,希望对你有一定的参考价值。

// Author: Jeroen Ransijn
// Auto updating copyright notice
function auto_copyright_notice($startYear,$txt) {  
  // this line will compare the startYear with the current year, if this is the same only display the startYear
  // if this is false, both show: $startYear 'en dash(Study Typography you nerd!)' $currentYear
  // note that if $starYear is bigger then the current year, 
  // or isn't an integer this function will still return the current year
  $year = ($startYear >= date("Y") ? date("Y") : $startYear . "–". date("Y"));		
  return $year . " © " . $txt;		
}

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

PHP 自动更新版权年份

自动更新版权年

原生JS在网页上复制的所有文字后面自动加上一段版权声明

复制文字时自动加版权

复制文字时自动加版权

PHP 用PHP更新版权日期