Jump to content

Need Help Generating a Calendar - Beginner


drugpeddlar

Recommended Posts

Hi, tried doing this, but with no success. I'm trying to design a function, where I get today's date, and then, using that, generate a calendar for this month and next month on the same page. My problem lies in the fact that i need the calendar to be formatted in a particular layout, like in a table, and I need the dates on it to be valid. Like, it should not show 30th Feb or 31st Sep. Any help would be great.
Link to comment
Share on other sites

put in the month and year, and it'll tell you how many days are in that month
[code]
<?
function get_daysinmonth($month, $year){
if(checkdate($month, 31, $year)) return 31;
elseif(checkdate($month, 30, $year)) return 30;
elseif(checkdate($month, 29, $year)) return 29;
elseif(checkdate($month, 28, $year)) return 28;
return FALSE;
}
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.