Get the App
SLTechnology News&Howtos  ›  Development  › 

How to automatically update copyright information display by php

Shulou Source: shulou.com Published: 2022-06-03 19:41:28 11月12日 Update

This article will explain in detail how php automatically updates the copyright information display. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The specific analysis is as follows:

We usually output copyright information at the bottom of the page, including year information, which needs to be modified every year. This simple code helps you solve this problem and update the year automatically.

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; else return $startYear;} / / usage: print'©'. AutoUpdatingCopyright (2001). ' Jb51.net';/*Output: (C) 2001-2012 jb51.net*/ on "how to automatically update copyright information display" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Tags: Information copyright update article year more e.g. good practical code content article knowledge question page analysis reference help related output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Docker macOS Xiaomi MariaDB