Copyright notice with a date range

/ Published in: PHP
Save to your folder(s)

Displays a copyright notice in the form 2011 - 2012, where the first year is hard coded and the second year is dynamically generated. If the start and current year are identical, only the start year is displayed.

Copy this code and paste it in your HTML
  1. Copyright <?php if (date('Y')!='2011'){ echo '2011 - '; } echo date('Y'); ?>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.