You would think it would be simple
So then why doesn't this work?
I've tried these two:
Code:$currentMonth = date("m"); $semester = ""; if ($currentMonth >= 01 && $currentMonth <= 05) { $semester = "Spring"; } elseif ($currentMonth >= 06 && $currentMonth <= 08) { $semester = "Summer"; } else { $semester = "Winter"; }It will give me either Winter using the && operator and Spring if I use the ||. But neither will give me Summer, which is what it should be since it's 07.Code:$currentMonth = date("m"); $semester = "0"; if ($currentMonth > 00 && $currentMonth < 06) { $semester = "Spring"; } elseif ($currentMonth > 05 && $currentMonth < 09) { $semester = "Summer"; } else { $semester = "Winter"; }
What do you think? Is it possible to get this to work?



Reply With Quote
Bookmarks