I have a form with a date picker which allows the user to select only the month and year. Upon submitting the form The value it gets from the form is:
$the_Date = $_POST['month_Year'];
echo 'month date: '.$the_Date.'<br />';
// echos 'month date: July 2015' in this example
I need to use this to create 2 dates. I need the 1st of July and the 31st of July. I can create the 1st no problems using:
$first_Of_Month = date("Y-m-d",strtotime('1 '.$the_Date));
But I don't know how to create the $last_Of_Month seeing as not all months end on the 31st. Any help would be greatly appreciated