sandy1028 Posted June 10, 2008 Share Posted June 10, 2008 Hi, $date1='2008-05-21'; $date2='2008-05-31'; How to find the dates between two dates using mktime() and push into an array Link to comment https://forums.phpfreaks.com/topic/109527-mktime/ Share on other sites More sharing options...
Barand Posted June 10, 2008 Share Posted June 10, 2008 i'd use strtotime() for this one <?php $date1='2008-05-21'; $date2='2008-05-31'; $t1 = strtotime($date1); $t2 = strtotime($date2); $dates = array(); while ($t1 <= $t2) { $dates[] = date ('Y-m-d', $t1); $t1 = strtotime('+1 day', $t1); } echo '<pre>', print_r($dates, true), '</pre>'; ?> Link to comment https://forums.phpfreaks.com/topic/109527-mktime/#findComment-561882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.