for Counter Counter Counter for Counter2 Counter2 Counter2 CurrentDay

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
for($Counter = 0; $Counter < 6; $Counter++)
{
for ($Counter2 = 0; $Counter2 < 7; $Counter2++)
{
$CurrentDay = getdate($StartDay);
if ($CurrentDay["mon"] != $Dates["mon"])
{
break;
}
if (($CurrentDay["wday"] - 1 == $Counter2 && $CurrentDay["wday"] != 0) or ($CurrentDay["wday"] == 0 && $Counter2 == 6))
{
$Calendar[$Counter][$Counter2] = $CurrentDay["mday"];
$StartDay += 60*60*24;
} else {
$Calendar[$Counter][$Counter2] = "-";
}
}
}