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
$month = 10; // october $firstday = date('01-' . $month . '-Y'); $lastday = date(date('t', strtotime($firstday)) .'-' . $month . '-Y');