How to use PHP to dynamically generate all copyright information

Source: Internet
Author: User
This article mainly introduces the PHP dynamic generation of all copyright information methods, examples of PHP time and string operation skills, with a certain reference value, the need for friends can refer to the next

This article explains how PHP dynamically generates all copyright information. Share to everyone for your reference. The implementation method is as follows:

function Copyright ($start, $owner) {$date = date (' Y '); echo "copyright"; if ($start < $date) {echo "{$start}-";} echo "{$date} {$owner}";}

Demo Example:

If the current year is 2013, use

Copyright (' A ', ' php.cn ');

Will output:

Copyright 2012-2015 php.cn

The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!

Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.