Home > Backend Development > PHP Tutorial > How to dynamically generate copyright information in php_PHP tutorial

How to dynamically generate copyright information in php_PHP tutorial

WBOY
Release: 2016-07-13 10:00:53
Original
1014 people have browsed it

How to dynamically generate copyright information in php

This article mainly introduces the method of dynamically generating copyright information in php, and analyzes the operation skills of php time and string with examples. It has certain reference value, friends in need can refer to it

The example in this article describes the method of dynamically generating copyright information in PHP. Share it with everyone for your reference. The specific implementation method is as follows:

?

1

2

3

4

5

6

7

8

function copyright($start, $owner) {

$date = date('Y');

echo "© Copyright ";

if ( $start < $date ) {

echo "{$start} - ";

}

echo "{$date} {$owner}";

}

1 2

3

4

5

6

7

1

copyright('2012', 'jb51.net');

8

function copyright($start, $owner) {

$date = date('Y');

echo "© Copyright ";

if ( $start < $date ) {

1

© Copyright 2012 - 2015 jb51.net

echo "{$start} - "; }

echo "{$date} {$owner}"; }

Demo example: If the current year is 2013, use ?
1 copyright('2012', 'jb51.net');
will output: ?
1 © Copyright 2012 - 2015 jb51.net
I hope this article will be helpful to everyone’s PHP programming design. http://www.bkjia.com/PHPjc/973108.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/973108.htmlTechArticleHow to dynamically generate copyright information in php. This article mainly introduces the method of dynamically generating copyright information in php, with examples. Analyzed the operation skills of PHP time and string, with certain reference...
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