Make Copyright the Current Year on PHP Website
We’ve got a quick tip today. If you are using WordPress or another PHP based platform, you can place the following code in your footer, next to a copyright ( © ) symbol and it will always display the current year.
Note: The code in the snippets below needs to be in <? ?> php tags. Not sure why my pre tags aren’t working properly and allowing me to put the code as-is…
php echo date("Y")
Hope this helps someone out there on the search for a solution to this!
And if you need to put the date anywhere else on your site, this works as well.
To display the three letter month, simply replace Y with M
php echo date("M")
For the day of the month, use “d”
php echo date("d")
For a full list of the available options, take a look at the php manual for the date function.
Very good.Thanks