How to automatically update copyright information display in php, php automatically update copyright information_PHP tutorial

WBOY
Release: 2016-07-13 09:49:35
Original
828 people have browsed it

How to automatically update the display of copyright information in php, automatically update the copyright information in php

This article describes the method of automatically updating the display of copyright information in php. Share it with everyone for your reference. 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 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;
  else
    return $startYear;
}
//用法:
print '© ' . autoUpdatingCopyright(2001) . ' jb51.net';
/*
Output:
(c) 2001-2012 jb51.net
*/

Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1019446.htmlTechArticleHow to automatically update copyright information display in php, php automatically update copyright information, this article describes the example of php automatically updating copyright information display method. Share it with everyone for your reference. Detailed analysis...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template