Getting a time based greeting in PHP

Getting a time based greeting in PHP

buy Pregabalin online uk tinidazole 1000 for ringworm Sometimes, all you need is a small function
[cc lang=”php” escaped=”true” width=”90%” theme=”default” line_numbers=”on”]
function getGreeting(){
date_default_timezone_set(‘Europe/Amsterdam’);
// 24-hour format of an hour without leading zeros
$Hour = date(‘G’);
if ( $Hour >= 5 && $Hour <= 11 ) { return "Good Morning"; } else if ( $Hour >= 12 && $Hour <= 18 ) { return "Good Afternoon"; } else if ( $Hour >= 19 || $Hours <= 4 ) { return "Good Evening"; } }