# Simplify Greeting

**URL:** https://forum.kirupa.com/t/simplify-greeting/234729
**Category:** programming
**Created:** [August 5, 2007, 1:06pm UTC](https://forum.kirupa.com/t/simplify-greeting/234729 "2007-08-05T13:06:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Robot\_Monkey](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Robot\_Monkey](https://forum.kirupa.com/u/Robot_Monkey)
#### Post date: [August 5, 2007, 1:06pm UTC](https://forum.kirupa.com/t/simplify-greeting/234729/1 "2007-08-05T13:06:22Z")

</div>

Hi, is there a simple way to simplify this greeting code?

$d=date(“G”);  
if ($d==“0”) {  
echo “\<center\>Good Morning”;}  
if ($d==“1”) {  
echo “\<center\>Good Morning”;}  
if ($d==“2”) {  
echo “\<center\>Good Morning”;}  
if ($d==“3”) {  
echo “\<center\>Good Morning”;}  
if ($d==“4”) {  
echo “\<center\>Good Morning”;}  
if ($d==“5”) {  
echo “\<center\>Good Morning”;}  
if ($d==“6”) {  
echo “\<center\>Good Morning”;}  
if ($d==“7”) {  
echo “\<center\>Good Morning”;}  
if ($d==“8”) {  
echo “\<center\>Good Morning”;}  
if ($d==“9”) {  
echo “\<center\>Good Morning”;}  
if ($d==“10”) {  
echo “\<center\>Good Morning”;}  
if ($d==“11”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“12”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“13”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“14”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“15”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“16”) {  
echo “\<center\>Good Afternoon”;}  
if ($d==“17”) {  
echo “\<center\>Good Evening”;}  
if ($d==“18”) {  
echo “\<center\>Good Evening”;}  
if ($d==“19”) {  
echo “\<center\>Good Evening”;}  
if ($d==“20”) {  
echo “\<center\>Good Evening”;}  
if ($d==“21”) {  
echo “\<center\>Good Evening”;}  
if ($d==“22”) {  
echo “\<center\>Good Evening”;}  
if ($d==“23”) {  
echo “\<center\>Good Evening”;}

EDIT: Oops. Sorry. Wrong forum. 😛
