我已经尝试了堆栈溢出和更多其他站点并获得了解决方案。 这是PHP代码
$fromDate = $results_min_max->min_date; // month / day / year
$toDate = $results_min_max->max_date; // month / day / year
$dateMonthYearArr = array();
$fromDateSTR = strtotime($fromDate);
$toDateSTR = strtotime($toDate);
for ($currentDateSTR = $fromDateSTR; $currentDateSTR <= $toDateSTR; $currentDateSTR += (60 * 60 * 24)) {
// use date() and $currentDateSTR to format the dates in between
$currentDateStr = date("j-n-Y",$currentDateSTR);
$dateMonthYearArr[] = $currentDateStr;
//print $currentDateStr."<br />";
}
希望这可以帮助某人。