postimg
Feb 2010 26

Update Your Website Copyright With Some Simple PHP0

Posted In PHP,Web Design By Tony Virelli

Ok, so every year web designers have the all dreaded task of updating the copyright on their designs. This isn’t so bad if you work for 1 company, but if you work for a design firm like I do and have tons of clients websites to update it can be a time eating task.

So to fix this problem I wrote this super small, super easy bit of code. It’s nothing special, but it gets the job done.

<?php
$startYear=2010; //Enter the starting year of the copyright.
if($startYear < date("Y")){
	echo $startYear."-".date("Y");
}else{
	echo $startYear;
}
?>

And for the function lovers

<?php
function updateCopyright($startYear){
	if($startYear < date("Y")){
		echo $startYear."-".date("Y");
	}else{
		echo $startYear;
	}
}
?>
//Usage: Copyright &copy; <?php echo updateCopyright(2010); ?> Company Name

There ya go!

Isn’t making your life easier fun!? I sure think so!

Leave a comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes