//GET DAYS MATCH CAN BE ON $finalizehours=$linfo[finalizehours]; $playdays=$linfo[playdays]; $spreadhours=24; $starthours=($finalizehours + $spreadhours); while($countdays < $playdays){ $thisday=date("l M d", mktime(date("H")+$starthours,date("i"),date("s"),date("m"),date("d")+$countdays,date("Y"))); //$challengedays=$challengedays.""; //GET CHALLENGABLE HOURS $hour="$linfo[starthour]"; $stophour=($linfo[endhour] + 1); while(($hour < $stophour) && ($hour < 25)){ $thishour=date("g a", mktime($hour,1,1,1,1,1)); $challengetimes=$challengetimes.""; $hour++; } $countdays++; }