PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Well, this can be done in many ways, be more specific about your needs.
Do you want the date to go from today to the date before todays in a years time?
Do you want the date to go from 01/01/xx to 31/12/xx?
You could just presume there's 31 days in all months and do some simple loops, but that's a poor man's choice.
If you do this properly, working out the days in February is going to be tricky, and I'm not sure how to do it. I'm sure you could Google along the lines of 'Working out the amount of days in February PHP'. Besides, I'm sure someone will follow me up and tell you just how to work out the amount of days in February given the year using PHP.
If you are designing an interface for something like taking a booking then this is a bad way to let the user choose a date, 365 options in a select box is far too much. A seperate select box for day, month and year is a good way to let the user choose a specific date, possibly in year, month, day order so that the day options can be populated upon the choice of month/year. Ofcourse there are fancy ways to let the user choose a date, like a calendar choice.
I have insurance inspectors login and change estimated completion dates, well they are sloppy to say the least so I just wanted a clean way for them to select the day that they are changing the ECD to. After this I have them hit a button and the program updates this date in the database.