Is there a way to calculate the first and last day of the current month?
Thanks,
Yes. PHP has functions for this. Look them up.
i'll even give you a link to the site
www.php.net
I think I will do just that.
ok then, good idea...
This seems to work and illustrates the use of the appropriate functions....
function getDaysInMonth($thisYear,$thisMonth) { $date=getdate(mktime(0,0,0,$thisMonth+1,0,$thisYear)); return $date["mday"]+1; }
Originally posted by stevebuk This seems to work and illustrates the use of the appropriate functions....
Nonononono! Don't do their work for them or that's all you'll end up doing! getdate()? Eeewww....
Well I thank you for your efforts stevebuk.. I am researching the "Correct" function to use..
And while I dont expect someone to "Do my work for them" as if We were pets or something.. A general point to the correct function isnt too much to ask.
Instead of downing everyone who is trying to learn!
I think people are happy to help, however it is useful to at least try to find the answer on your own first... a search for 'calendar' on PHP's site would have gotten you a solution. 🙂
Personally, I would use the Calendar functions....
http://www.php.net/manual/en/ref.calendar.php
Oh please dont get me wrong. I have gotten alot of help from this site. And I am truely amazed at the knowledge here. As well as, very grateful for all the help. Not intended to offend anyone.
Thank you for pointing me in the direction.. I was scouring for it..