Add Copyright Symbol and Year Date in PHP

To add a copyright symbol and year date in PHP that updates with the current year, you can use the code below…

&copy; <?php echo date ('Y'); ?>

An HTML entity is used for the copyright symbol, then you have an opening PHP declaration followed by an echo, which is rendering the year using the date function date (‘Y’);, then the PHP tag is closed. The date function will ensure that the copyright year will always stay current and echo out the year we are in.

The changing of the year can be debatable,  the year in some instances does not to be updated if the original design and content haven’t changed or only slightly changed if however there are major revisions and design best to update the year – see this for some more reference.

Leave all Comment