Reputation: 495
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?
Upvotes: 4
Views: 1751
Reputation:
You can use date, since the year will remain a year. for instance,
<?php echo date("Y"); ?>
Personal experience in researching in Google.
Upvotes: 2
Reputation: 590
You can use date('Y')
$startdate = date("Y-m-d", strtotime(date('Y') . '-' . $startmonth . '-01'));
Upvotes: 5