Hi All:
I am receiving a querystring for the month. Let's say the querystring is "5". I want that to read "May" on my page.
I know I can do a switch and list all 12 months etc., but I was wondering of date formatting would accomplish this with 1 line of code. I couldn't find anything. here is "phony" code to give you an idea of what I was thinking:
$smonth = $_GET("month"];//Lets say this is *5* $smonth = date('F', $smonth);
Thanks!
$monthname = date("M", mktime(0, 0, 0, $smonth, 1, 2000));
or
$monthnames = array('Jan', 'Feb' /* etc */); $monthname = $monthnames[$smonth - 1];
paulnaj;10977507 wrote:$monthname = date("M", mktime(0, 0, 0, $smonth, 1, 2000)); or $monthnames = array('Jan', 'Feb' /* etc */); $monthname = $monthnames[$smonth - 1];
PERFECT!