RE: [PHP-DB] Use date in For Loop

From: Date: Thu, 01 May 2003 11:40:34 +0000
Subject: RE: [PHP-DB] Use date in For Loop
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-27466@lists.php.net to get a copy of this message
Ramesh PAtel wrote: > Hi All > > please give one help > > I want to us date variable in for loop Condition. > > But it not working Properly. > $dt='2003-04-22' ; > $to='2003-04-30'; > > FOR ( $dt=$dt; $dt > $to ; ) > { > print "XYz"; > } > You can't do this. What you need to do is convert your date into a timestamp using mktime() and then do the comparison. Cheers, Greg.

« previous php.db (#27466) next »