Jump to content

Php calendar problem


carlfaulkner

Recommended Posts

I found a tutorial on events calendar and it works great only I want to change the day to start on Monday and not Sunday. I can change the array of days of the week but the dates all go wrong. Can anyone helpThis is the code:<?php$days = Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");echo "<table border=\"1\" cellpadding=\"3\"><tr>\n";foreach ($days as $day){ echo "<td style=\"background-color: #CCCCCC; text-align: center; width: 14% \"><strong>$day</strong></td>\n";}for ($count=0; $count < (6*7); $count++){ $dayArray = getdate($start); if (($count % 7) == 0){ if ($dayArray['mon'] != $month){ break; } else { echo "</tr><tr>\n"; } } if ($count < $firstDayArray['wday'] || $dayArray['mon'] != $month){ echo "<td> </td>\n"; } else { echo "<td>".$dayArray['mday']." </td>\n"; $start += ADAY; }}echo "</tr></table>";?></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...