I am trying to create a calendar where the date increments and each date is clickable, which links to a search. The strange part is that the date stops at 25th October
, and stops incrementing. i.e 24th, 25th, 25th, 25th...
Its doesn't matter which day the calendar started with (been staring at it for a few days), but at 25th it stops incrementing
.
Grateful for any advice.(The 2nd part after the gap is probably irrelevant, but including it in case there could be any link)
for ($i = 1; $i <= 30; $i++){
$date = date("d-m-Y", strtotime($date) + 86400);
array_push($array_date, $date);
$separatedate = explode('-', $date);
$getday = date("l", strtotime($date));
print "<button class='submitsearch btn' value=$array_date[$i]>" . ltrim($separatedate[0], '0') . "<br>" . $getday . "<br></button>";
if (!checkdate($separatedate[1] , $separatedate[0]+1 , $separatedate[2])) {
$nextmonth = date("F", strtotime($date) + 86400);
print "<strong>". $nextmonth . "</strong><hr/>";
}
}