I wish to rewrite a mysql query which use month() and year() functions to display all the posts from a certain month which goes to my function as a \'Y-m-d\' parameter forma
cal_days_in_month() should give you the total number of days in the month, and therefore, the last one.