Re: Date (Year) .. adding..

From: Date: Wed, 23 May 2001 04:32:22 +0000
Subject: Re: Date (Year) .. adding..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53981@lists.php.net to get a copy of this message
On Wed, 23 May 2001 13:49, Jason Caldwell wrote: > I'm trying to figure out how to add to the year: > > for($x=0; $x<20; $x++) > { > $year = date("Y" + $x); > print($year . "\n"); > } > > I've tried several variations on the above and cannot get the year to > come out. > > Any suggestions? > > Thanks > Jason for($x=0; $x<20; $x++) { $year = date("Y") + $x; // Shift bracket! print($year . "\n"); } -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA It is fatal to live too long.

« previous php.general (#53981) next »