<?php
/* Copyright Date
--------------------------*/
function copyright_date($creation_year) {
$current_year = date('Y');
if ($creation_year == $current_year || $creation_year == '') {
echo $current_year;
}
else {
echo $creation_year . '-' . $current_year;
}
}
?>
If someone forgets to add the argument (the year the website was created), e.g.
<?php copyright_date(); ?>
instead of:
<?php copyright_date(2009); ?>
how would I test to see if the argument was left blank? In my if statement, that's what $creation_year == '' is for, but since the argument isn't a string, it doesn't work.