function getDateList($sdate,$edate)
{
$dateList = array();
try{
$sDateList = explode('-',$sdate);
$eDateList = explode('-',$edate);
$sdate = mktime(0,0,0,$sDateList[1],$sDateList[2],$sDateList[0]);
$edate = mktime(0,0,0,$eDateList[1],$eDateList[2],$eDateList[0]);
if($sdate > $edate or $sdate > time())
{
return null;
}
if ($edate > time())
{
$edate = time();
}
}catch(Exception $e){
return null;
}
while($sdate <= $edate)
{
array_push($dateList,date('Y-m-d', $sdate));
$sdate = $sdate + 60*60*24;
}
return $dateList;
}
|