This article mainly introduces how php automatically updates the display of copyright information. The example shows how php selects the display mode based on time. For more information, see
This article mainly introduces how php automatically updates the display of copyright information. The example shows how php selects the display mode based on time. For more information, see
This article describes how php automatically updates the copyright information display. Share it with you for your reference. The specific analysis is as follows:
We usually output copyright information at the bottom of the page, including the year information, which needs to be modified every year. This simple code will help you solve this problem and automatically update the year.
Function autoUpdatingCopyright ($ startYear) {// given start year (e.g. 2004) $ startYear = intval ($ startYear); // current year (e.g. 2007) $ year = intval (date ('y'); // is the current year greater than the // given start year? If ($ year> $ startYear) return $ startYear. '-'. $ year; elsereturn $ startYear;} // usage: print'©'. AutoUpdatingCopyright (2001). 'jb51.net';/* Output :( c) 2001-2012 jb51.net */
I hope this article will help you with php programming.