Quick Search:
 
 PHP Code: What Season Is It? Jump to:  
Category: >> PHP Code >> What Season Is It?  

<< lastnext >>

Snippet Name: What Season Is It?

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

Also see:
» Convert UK Dates To mySQL Format Dates
» Delete files older than 'X'
» String to Date
» Month, Day, Year dropdown boxes
» Calculate date of Easter Sunday
» Define a schedule of holidays
» Calendar for any month any year
» Add and Subtract dates
» Basic PHP Calendar
» Convert Standard time to 24-hour time ...
» Delete by date
» Days in month #2
» Days in month one
» Count days between dates
» Find days between dates one
» Build Date Select Boxes

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

<?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();
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org