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
https://forums.phpfreaks.com/topic/28217-need-help-generating-a-calendar-beginner/
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]

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.