note 70747 added to function.date

From: Date: Thu, 26 Oct 2006 08:38:41 +0000
Subject: note 70747 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-119129@lists.php.net to get a copy of this message
my quick and dirty code to find the season of the current date <?php function season() { $limits=array('/12/21'=>'Winter', '/09/21'=>'Autumn', '/06/21'=>'Summer', '/03/21'=>'Spring', '/01/01'=>'Winter'); foreach ($limits AS $key => $value) { $limit=date("Y").$key; if (strtotime($adate)>=strtotime($limit)) { return $value; } } } echo season(); ?> PS: the 21th is a good approach but not the real day. ---- Server IP: 194.153.94.10 Probable Submitter: 155.105.128.19 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/70747 Del: integrated -- https://master.php.net/note/delete/70747/integrated Del: useless -- https://master.php.net/note/delete/70747/useless Del: bad code -- https://master.php.net/note/delete/70747/bad+code Del: spam -- https://master.php.net/note/delete/70747/spam Del: non-english -- https://master.php.net/note/delete/70747/non-english Del: in docs -- https://master.php.net/note/delete/70747/in+docs Del: other reasons-- https://master.php.net/note/delete/70747 Reject -- https://master.php.net/note/reject/70747 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#119129) next »