Solarpitch Posted January 16, 2009 Share Posted January 16, 2009 Hey, I have a variable in my app that receives the month and year in this format: "January 2009" I then need to break it up into its respective month number ie: "01" as its January and then the year "2009" Just wondering how I can break it down so I can store it like $month = 01; $year = 2009; I should mention I've been looking through http://ie.php.net/date but cant seem to find a solution I can adapt. Link to comment https://forums.phpfreaks.com/topic/141060-help-needed-with-date-month-and-year/ Share on other sites More sharing options...
Mark Baker Posted January 16, 2009 Share Posted January 16, 2009 look at strtotime() to convert your month and year into a timestamp value, then you can use date() to format it as you wish Link to comment https://forums.phpfreaks.com/topic/141060-help-needed-with-date-month-and-year/#findComment-738268 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.