PHP automatically updates the method of displaying copyright information, PHP automatically updates the copyright information
This paper describes the method of automatic updating of copyright information in PHP. Share to everyone for your reference. The specific analysis is as follows:
We usually export the copyright information below the page, including the year information, the annual change, this simple code to help you solve this problem, automatically update the year
function Autoupdatingcopyright ($startYear) { //given start year (e.g. 2004) $startYear = Intval ($startYear); Current year (e.g) $year = intval (Date (' Y ')); Is the current year greater than the //given start year? if ($year > $startYear) return $startYear. ' -'. $year; else return $startYear;} Usage: print ' © '. Autoupdatingcopyright (2001). ' Jb51.net ';/*output: (c) 2001-2012 jb51.net*/
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/1019446.html www.bkjia.com true http://www.bkjia.com/PHPjc/1019446.html techarticle PHP automatically updates the method of displaying the copyright information, PHP automatically update the copyright information in this paper, the method of automatic updating of copyright information in PHP is described. Share to everyone for your reference. Specific analysis ...