Yes there is a problem with that code. As it should look like this:
$dates = date(" d-m-y",$mytime));
if ($dates == date('d-m-y')) {
$day_name = 'This day';
} elseif (YOU-CAN-COMPARE IT TO SOMETHING ELSE AGAIN IN HERE) {
$day_name = 'Another day';
}
echo "$day_name";
Or if you are not willing to compare it for a second time, use this:
$dates = date(" d-m-y",$mytime));
if ($dates == date('d-m-y')) {
$day_name = 'This day';
} else {
$day_name = 'Another day';
}
echo "$day_name";