Hi, I should have posted what I have so far. So I had three versions of solving this, they are below:
<?= '© 2015 -' . date("Y");?>
<?php function auto_copyright($year = 'auto'){
if(intval($year) == 'auto'){ $year = date('Y'); }
if(intval($year) < date('Y')){ echo '© ' . intval($year) . ' - ' . date('Y'); }
if(intval($year) > date('Y')){ echo '© ' . date('Y'); }
} auto_copyright();
auto_copyright('2016'); ?>
<?php
$startDate = 2015;
$currentDate = date('Y');
echo '© ' . $startDate . (($startDate != $currentDate) ? '-' . $currentDate : ''); ?>
What I am looking for is another way to solve this, particularly involving function.
Cheers