PHP Copyright Date Code

Here is a snippet of code that I am using for the copy­right date on my website. I had found a snippet of code that similar and simpler online and cannot find it again. I am new to PHP coding and needs some help with this, I want to make my snippet of code more concise and simpler. Leave a comment if you can help.

Thanks,

<?php $start_year = 2008;
if ( $start_year == date(Y) ) {
echo date(Y);
} else {
echo “$start_year — “.date(“Y”);
} ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>