PHP. Display Morning, Afternoon or Evening Welcome Message

This little PHP snippet will display a friendly welcome message according to what is the time of the day.

$welcome = 'Hi';
if (date("H") < 12) {
    $welcome = 'Good morning';
} else if (date('H') > 11 && date("H") < 18) {
    $welcome = 'Good afternoon';
} else if(date('H') > 17) {
    $welcome = 'Good evening';
}

echo $welcome;