PHPackages                             waughj/copyright-year - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. waughj/copyright-year

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

waughj/copyright-year
=====================

Simple class for handling auto-updating copyright year in website footers.

v2.0.0(6y ago)079AGPL-3.0-or-laterPHPPHP &gt;=7.2

Since Jun 3Pushed 6y agoCompare

[ Source](https://github.com/waughjai/copyright-year)[ Packagist](https://packagist.org/packages/waughj/copyright-year)[ RSS](/packages/waughj-copyright-year/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

Copyright Year
==============

[](#copyright-year)

Simple class for handling auto-updating copyright year in website footers.

Description
-----------

[](#description)

Adds copyright year or interval o' years where desired. By default, it just shows the current year, as specified by the server ( which is hopefully keeping accurate track o' time ). Optionally, you can include a start year. If the start year is different from the current year, then it will show an interval 'tween the start year &amp; current year.

For instance, if you set the start year to 2015, in 2018 you will get the following:

`2015 - 2018`

You can also set a custom divider if you want the interval sign to look different. For instance, if you don't want the hyphen to have spaces round it, you could set the divider to "-", &amp; you will get the following:

`2015-2018`

Installation
------------

[](#installation)

Copyright year can be directly added to PHP files by creating an instance o' the \\WaughJ\\CopyrightYear\\CopyrightYear class &amp; using it like a string or calling the "getText()". Optional arguments to its constructor are 1st the starting year o' your website &amp; 2nd the divider you want 'tween the start year &amp; current year if they are different. The defaults for these, respectively, are the current year &amp; a hyphen with spaces round it.

If using WordPress, you can also add a copyright year to a WordPress document using a shortcode. Add \[copyright-year\] to add the current year &amp; \[copyright-year start="%year%" divider="%divider%"\] with %year% replaced by the starting year &amp; %divider% replaced by the divider that appears 'tween the start &amp; current year if they are different.

Example
-------

[](#example)

```

		Copyright Jaimeson Waugh &copy; .
