Hallo,
Ik heb een kalendertje gemaakt in PHP.
Nu begint hij altijd met de eerste van de maand.
Deze maand was dit een woensdag, waardoor een woensdag elke week de eerste dag is. Ik wil echter dat elke lijn begint met een maandag.
Hoe moet dit ?
Hopelijk kunnen jullie me helpen.
Groetjes, Maarten.
toevoeging op 6 augustus 2012, 16:07:33:
Gevonden,
met een for een aantal tds doen
Ik heb een kalendertje gemaakt in PHP.
Nu begint hij altijd met de eerste van de maand.
Deze maand was dit een woensdag, waardoor een woensdag elke week de eerste dag is. Ik wil echter dat elke lijn begint met een maandag.
Hoe moet dit ?
[COLOR= #0000BB]<?[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$startMonth[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$startMonth[/COLOR] [COLOR= #007700]<=[/COLOR] [COLOR= #0000BB]$endMonth[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$startMonth[/COLOR][COLOR= #007700]++)
{[/COLOR]
[COLOR= #0000BB]$dayNameGet[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mktime"]mktime[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700]),[/COLOR][COLOR= #0000BB]$startMonth[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Y"[/COLOR][COLOR= #007700]));[/COLOR]
[COLOR= #0000BB]$dayNameNumber[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/Date"]Date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]N[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dayNameGet[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$dayName[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ucfirst"]ucfirst[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$days[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$dayNameNumber[/COLOR][COLOR= #007700]]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$startMonth[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$weekDays[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]7[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</tr><tr>[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$weekDays[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<td>
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$dayName[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000] [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$startMonth[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]/[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/Date"]Date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]m[/COLOR][COLOR= #007700]);[/COLOR] ?>
<br />
Hier komen de afspraken
</td>
[COLOR= #0000BB]<?
$weekDays[/COLOR][COLOR= #007700]++;
}
}[/COLOR] Hopelijk kunnen jullie me helpen.
Groetjes, Maarten.
toevoeging op 6 augustus 2012, 16:07:33:
Gevonden,
met een for een aantal tds doen
