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...