Re: Weird Behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 20, 2010 at 07:35:26AM -0700, Don Wieland 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"

No, $qCur is set to 1.

You've forgot the semicolons if you're testing with this.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux