Hi Mike, > > > Is there a magical function that I can use to convert 4 > > > into April and 5 into May etc? > > > can I use mktime() > > > One yes no answer will do fine > > > > Yes and no ;-) > > Ha! I was just about to say exactly that myself!
It was just too tempting :-) > Except, to get just the month (and leaving out > optional arguments to mktime()), you would need: > date('F', mktime(12, 0, 0, $month)); Hmm. I thought this should work as well. This morning, though, I had to fix a bug where a combo box was displaying something like "January" "March" "March" "April" "May" "May" ... The code was <select name="lm"> <?php for ($i=1; $i<=12; $i++) { echo "<option value=\"". $i. "\""; echo ($i == $lm) ? " selected" : ""; echo ">". date ("F", mktime (3, 0, 0, $i)). "</option>"; } ?> </select> When I changed the mktime parameters to (3, 0, 0, $i, 1, 2002) it all worked fine. I think it's because it's the 31st today, and any months that don't have 31 days were getting screwed up (wouldn't mind hearing any other ideas though). It seems like it's always a good idea to pass at least the day parameter to mktime(), unless you enjoy unpredictable results ;-) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php