drugpeddlar Posted November 23, 2006 Share Posted November 23, 2006 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. Quote Link to comment Share on other sites More sharing options...
taith Posted November 23, 2006 Share Posted November 23, 2006 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] Quote Link to comment Share on other sites More sharing options...
CheesierAngel Posted November 23, 2006 Share Posted November 23, 2006 Nice tutorial about creating a calender:- [url=http://www.phpfreaks.com/tutorials/83/0.php]http://www.phpfreaks.com/tutorials/83/0.php[/url] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.