How can I get the last day (Dec 31) of the current year as a date using PHP?
I tried the following but this doesn't work:
$year = date('Y');
$yearEnd = strtotime($year . '-12-31');
strtotime() uses the current date/time as a basis (so it will use this current year), and you need
date() to format:
$yearEnd = date('Y-m-d', strtotime('Dec 31')); //or $yearEnd = date('Y-m-d', strtotime('12/31'));