I want to check if an event from this year is in the future or over. So i buildt this and it works.
$date = new DateTime('2016-04-07');
$now = new DateTime();
if($date > $now) {
echo 'future';
} else {
echo 'past';
}
But i don't want to change every year the "2016
" to keep it working in the next year.
Is it possible to add for the 2016
the actually year?
Something like:
$date = new DateTime('".date('Y')."-04-07');
Thanks