note 37021 deleted from function.mktime by sniper

From: Date: Tue, 04 Nov 2003 13:09:11 +0000
Subject: note 37021 deleted from function.mktime by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59857@lists.php.net to get a copy of this message
Note Submitter: smcca69@eq.edu.au ---- I created an array of months with the following code to populate a select box. On months that have 31 days my array would skip the next month as it contained 30 days. for ($i = 0; $i <= 11; $i++) { $myday = mktime (0,0,0,date("m")+$i,date("d"),0); $mymonth = date("F", $myday); $montharray[$i] = array($mymonth); } I changed the code to set the day of the month statically to the 15th. Now the array won't skip months. Hope this helps, anyone with the same problem. for ($i = 0; $i <= 11; $i++) { $myday = mktime (0,0,0,date("m")+$i,15,0); $mymonth = date("F", $myday); $montharray[$i] = array($mymonth); }

« previous php.notes (#59857) next »