Automatic copyright updater in PHP

To update your copyright notice in PHP all you have to do is to pass “y” to date() function. The following PHP code demonstrates how to use the date() function to generate the current year automatically.

<p>&copy; 2006&#8211;<?php echo date('Y'); ?> Faraz Kelhini</p>

&copy represents @, and #8211 represents dash in html.

Leave a Comment.