Checking a date between two dates bug, clueless
<p>This function returns an array of dates in between two dates.</p>

<p>Now it works completely fine, except for some unknown reason, if I put it the month of November or the month of March as the arguments, I get an array of one day less. The other months work completely fine. I am absolutely clueless.</p>

<pre><code>function getListofDatesInRange2($fromDate, $toDate)
{
    $fromDate = str_replace("-","/", $fromDate);
    $toDate = str_replace("-","/", $toDate);

    $dateMonthYearArr = array();
    $fromDateTS = strtotime($fromDate);
    $toDateTS = strtotime($toDate);

    for ($currentDateTS = $fromDateTS; $currentDateTS &lt;= $toDateTS; $currentDateTS += (60 * 60 * 24)) {
        $currentDateStr = date("m-d-Y",$currentDateTS);
        $dateMonthYearArr[] = $currentDateStr;
    }

return $dateMonthYearArr;
}
</code></pre>

<p>I recoded it, and a while loop solved my issue. (although i have no idea what the issue was in the first place)</p>

<pre><code>function getListofDatesInRange2($fromDate, $toDate)
{
$fromDate = str_replace("-","/", $fromDate);
$toDate = str_replace("-","/", $toDate);

$dateMonthYearArr = array();
$fromDateTS = strtotime($fromDate);
$toDateTS = strtotime($toDate);

array_push($dateMonthYearArr, date('m-d-Y', $fromDateTS));
while($fromDateTS &lt; $toDateTS) {
    $fromDateTS += 86400;
    array_push($dateMonthYearArr, date('m-d-Y', $fromDateTS));
}
return $dateMonthYearArr;
</code></pre>

<p>}</p>
