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? 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. Link to comment https://forums.phpfreaks.com/topic/109681-parsing-a-date/#findComment-562815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.