I have this:
$startdate = date("Y-m-d", strtotime('2015-' . $startmonth . '-01'));
But instead of filling in the year, how do I get the current year?
I have this:
$startdate = date("Y-m-d", strtotime('2015-' . $startmonth . '-01'));
But instead of filling in the year, how do I get the current year?
You can use date('Y')
$startdate = date("Y-m-d", strtotime(date('Y') . '-' . $startmonth . '-01'));
You can use date, since the year will remain a year. for instance,
<?php echo date("Y"); ?>
Personal experience in researching in Google.