转自:百度知道 http://zhidao.baidu.com/question/171515427.html 例如给出的条件是 开始日期:2010-01-01,结束日期:2010-03-15 我要循环2010-01-01 至 2010-03-15 中间的所有日期。$j=0; for($i = strtotime('2010-01-01'); $i < strtotime('2010-03-15 '); $i += 86400) { $y=mktime(0,0,0,01,01,2010); $t=date("Y-m-d",$y+$j*24*3600); print $t.'<br/>'; $j++; }