Re: Weird Behavior

From: Date: Wed, 20 Oct 2010 14:44:17 +0000
Subject: Re: Weird Behavior
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-308886@lists.php.net to get a copy of this message
On Wed, Oct 20, 2010 at 10:35, Don Wieland <donw@dwdataconcepts.com> wrote: > Little help please ;) > > $CD = 1287583899 > $q1s = 1283313600 > $q1e = 1291093200 > $q2s = 1291179600 > $q2e = 1298869200 > $q3s = 1298955600 > $q3e = 1306814400 > $q4s = 1306900800 > $q4e = 1314763200 > > Why does the following not return the value "1" in the  $qCur var > > // Current Quarter > if($CD >= $q1s && $CD <= $q1e) $qCur = 1; > if($CD >= $q2s && $CD <= $q2e) $qCur = 2; > if($CD >= $q3s && $CD <= $q3e) $qCur = 3; > if($CD >= $q4s && $CD <= $q4e) $qCur = 4; > > it returns "4" That will return 1 if you add semicolons to the end of your variable definition block lines. Otherwise you'll get an unexpected T_VARIABLE error. In fact, I just tested it and it returned 1 as expected. -- </Daniel P. Brown> Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/

« previous php.general (#308886) next »