Performance is of the utmost importance on this one guys... This thing needs to be lightning fast! How would you validate the number of days in a given mont
You can use DateTime to solve this:
new DateTime('20090901')->format('t'); // gives the days of the month