Re: Increase a month

From: Date: Fri, 21 Mar 2003 03:18:10 +0000
Subject: Re: Increase a month
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140532@lists.php.net to get a copy of this message
For this exact instance (ie, trying to get the current month, and next month) then all you need is: <? $thisMonth = date(F,strtotime('today')); $nextMonth = date(F,strtotime('next month')); ?> Justin on 21/03/03 1:00 AM, shaun (shaun@mania.plus.com) wrote: > Hi, > > could someone tell me why this: > > <?php > $month = date(m); > echo "\$month: ".date(F,strtotime($month))."<br>"; > $month = $month + 1; > echo "\$month: ".date(F,strtotime($month))."<br>"; > ?> > > outputs this: > > $month: March > $month: March > > surely it should be: > > $month: March > $month: April > > Thanks in advance for your help. > >

« previous php.general (#140532) next »