Re: dynamic copyright in page footer?

From: Date: Sat, 30 Apr 2011 16:37:01 +0000
Subject: Re: dynamic copyright in page footer?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-312595@lists.php.net to get a copy of this message
lør, 30 04 2011 kl. 11:18 +0000, skrev dholmes1031@gmail.com: > Something simple like this would work > $date=date('Y'); > $startdate='2011'; > if($date == $startdate) { > echo $startdate > } else { > Echo $startdate; > Echo '-'; > echo $date; > > } > Sent via BlackBerry from T-Mobile > > -----Original Message----- > From: David Mehler <dave.mehler@gmail.com> > Date: Sat, 30 Apr 2011 07:06:17 > To: php-general<php-general@lists.php.net> > Subject: [PHP] dynamic copyright in page footer? > Hello, > > I am trying to use php to put a copyright notice in a page footer. I'm > using the date function with the "Y" value for the year. Here's the > code: > > <?php > echo date ('Y'); > ?> > > This works great for a site done in 2011 but next year I'm going to > want to have 2011 and 2012 in the copyright notice, adding an > additional year the site's up. I'd appreciate some suggestions i'm > very likely overthinking this. > > Thanks. > Dave. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > Hi there, I have been using the following little chunk: <?php $startYear = 2010; $curYear = date("Y"); echo "&copy; ".$startYear.(($startYear!=$curYear)?' - '.$curYear : ''); ?> Regards Lars Nielsen http://www.lfweb.dk

« previous php.general (#312595) next »