分类:
2006-06-28 09:49:19
$d0 = '2005-02-27'; $d1 = '2006-04-12'; $ar = range(strtotime($d0), strtotime($d1), 24*60*60); $ar = array_map(create_function('$v', 'return date("Y-m-d", $v);'), $ar); print_r($ar); ?> |
$d0 = '2005-02-27'; $d1 = '2006-04-12'; $ar = range(strtotime($d0)/86400+1, strtotime($d1)/86400+1); //注:原文得出结果会前移一天,需+1 $ar = array_map(create_function('$v', 'return date("Y-m-d", $v*86400);'), $ar); print_r($ar); ?> |