40esp Posted June 11, 2008 Share Posted June 11, 2008 how would I parse a date like: 2006-12-25 to create a variables called: $year $month $day with values from the string? Quote Link to comment https://forums.phpfreaks.com/topic/109681-parsing-a-date/ Share on other sites More sharing options...
pocobueno1388 Posted June 11, 2008 Share Posted June 11, 2008 <?php $date = "2006-12-25"; list($year, $month, $day) = explode("-", $date); I didn't test this, but it should work. Quote Link to comment https://forums.phpfreaks.com/topic/109681-parsing-a-date/#findComment-562815 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.