Re: [PHP] Date (Year) .. adding..

2001-05-23 Thread Rob Hardowa
I like Tyler's solution. It is better to move the call to date() outside the loop. You only need to get the current year once, and then add one onto it each iteration. If you leave the call to date() inside the loop then it calculates the current date each time and that uses CPU power and t

Re: [PHP] Date (Year) .. adding..

2001-05-23 Thread mheumann
Hi Jason, You might want to put the '+$x' outside the date(). $year = date("Y") + $x; Greetings, Michael. > 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 a

Re: [PHP] Date (Year) .. adding..

2001-05-22 Thread David Robley
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?

RE: [PHP] Date (Year) .. adding..

2001-05-22 Thread Tyler Longren
Try that. Tyler > -Original Message- > From: Jason Caldwell [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 11:20 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Date (Year) .. adding.. > > > I'm trying to figure out how to add to the year: > > for($x=0; $x<20; $x++) > { > $ye