SkyRanger Posted February 10, 2012 Share Posted February 10, 2012 I am trying to convert Numbers to months from mySQL. What I current have in my db is smonth = # What I am trying to figure out is if there is a way to do an array that will convert the # to a month instead of use if $smonth = 1 echo January. Any help is greatly appreciated and thank you in advance. Link to comment https://forums.phpfreaks.com/topic/256778-array-question/ Share on other sites More sharing options...
SkyRanger Posted February 10, 2012 Author Share Posted February 10, 2012 Nevermind. Figured it out. Had to use mktime to get it to work. $month_number = $rows['smonth']; $month_name = date( 'F', mktime(0, 0, 0, $month_number) ); echo $month_name; Link to comment https://forums.phpfreaks.com/topic/256778-array-question/#findComment-1316372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.