garevn Posted March 18, 2013 Share Posted March 18, 2013 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 More sharing options...
garevn Posted March 18, 2013 Author Share Posted March 18, 2013 I did an if-else statement tnx though! Link to comment Share on other sites More sharing options...
Mudsaf Posted March 18, 2013 Share Posted March 18, 2013 Instead of 5 lines i writed <p>Copyright 2012-<?php echo date("Y"); ?> by MYNAME. All rights reserved.</p> Link to comment Share on other sites More sharing options...
Ingolme Posted March 18, 2013 Share Posted March 18, 2013 (edited) 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 March 18, 2013 by Ingolme Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now