2013-01-23 167 views

回答

3

这应该做的工作。

<?php 
$start = '2013/01/01'; //start date 
$end = '2013/01/30'; //end date 

$dates = array(); 
$start = $current = strtotime($start); 
$end = strtotime($end); 

while ($current <= $end) { 
    $dates[] = date('Y/m/d', $current); 
    $current = strtotime('+1 days', $current); 
} 

//now $dates hold an array of all the dates within that date range 
print_r($dates); 
?> 
+0

嗨,伊格纳斯,感谢您的宝贵回应...它给出的O/P为阵列[0] => 1970-01-01,而我选择了其他日期范围 – Siddesh

+0

嗨伊格纳斯,谢谢!它终于工作,欢呼! – Siddesh