What Season Is It?

Description: Simple PHP script tells you what season it is.

<?PHP
 
FUNCTION season() {
   $limits=ARRAY('/12/21'=>'Winter','/09/21'=>'Autumn','/06/21'=>'Summer','/03/21'=>'Spring','/12/31'=>'Winter');
   FOREACH ($limits AS $key => $value) {
       $limit=DATE("Y").$key;
       IF (STRTOTIME("now")>strtotime($limit)) {
           RETURN $value;
       }
   }
}
 
ECHO season();
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.