Jump to content

dynamic copyright


garevn

Recommended Posts

I am using this code and the result is "© Copyright 2013 - 2013". I want if possible if the current year is the same with the copyright year to display only one. for example the display will be "© Copyright 2013".

<?php$time = time () ;$year= date("Y",$time);echo "© Copyright 2013 - " . $year;?>

Link to comment
Share on other sites

Only print the year if it's greater than the year the page was created.

Copyright <?php $year = idate('Y');echo '2013';if($year > 2013) {   echo '-' . $year;}?>

Edit: It seems it was already solved

Edited by Ingolme
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...