ankur0101 Posted May 17, 2012 Share Posted May 17, 2012 Hi, In my database, date is stored as in the format of YYYY-MM-DD Something like $date = 2012-04-01 How can I extract this as follows ... $year = 2012 $month = 04 $day = 01 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/262686-how-to-do-yyyy-mm-dd-to-x-y-z/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 17, 2012 Share Posted May 17, 2012 list($year,$month,$day) = explode('-',$date); Quote Link to comment https://forums.phpfreaks.com/topic/262686-how-to-do-yyyy-mm-dd-to-x-y-z/#findComment-1346398 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.