Last active
September 15, 2015 15:59
-
-
Save josephhinson/c70fcbe15035f0363e87 to your computer and use it in GitHub Desktop.
Return the current season based on day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function return_season() { | |
$day = date('z'); | |
if( $day < 79) $season = 'winter'; | |
elseif( $day < 171) $season = 'spring'; | |
elseif( $day < 265) $season = 'summer'; | |
elseif( $day < 354) $season = 'fall'; | |
else $season = "winter"; | |
return $season; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment