1. Regular solution (without use of PHP)
a. (Code) Open a new file or your existing footer.php file. You probably have your year dates hard coded in there:

b. (Output) This will simply display:

2. Dynamic Solution (In-line)
a. (Code) to display the year (using PHP inline code) is simply <?php echo date("Y"); ?>

b. (Output)

3. Dynamic Solution (as a Function) without a start date
a. (Code) to display the year (using a function instead of in-line code):
<?php
function dynamic_date($startyear) {
if (isset($startyear)) {
echo "".$startyear."-".date("Y")."";
} else {
echo date("Y");
}
}
?>
© ThinkTutorial <?php dynamic_date(); ?>
View in editor:

b. (Output)

4. Dynamic Solution (as a Function) with a start date
a. (Code) to display the year (using a function instead of in-line code) with a start date of “2010″ for example:
<?php
function dynamic_date($startyear) {
if (isset($startyear)) {
echo "".$startyear."-".date("Y")."";
} else {
echo date("Y");
}
}
?>
© ThinkTutorial <?php dynamic_date("2010"); ?>
View in editor:

b. (Output)

3 Responses and Counting
i can has cheeseburger?
I was confused but this clears it all up, thanks
I need this stuff right now! Anyway, I had hard times finding the right steps but I think this worth all the long hours that I wait.