Jump to content

mktime


sandy1028

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.