Question
Time using switch function
I am trying to get my php script to say Good morning and then
Good afternoon using military time. I can't see to get the script
to run properly. Here is what I have, what am I missing.
<?php
$today = date("G");
switch(date("G")){
case(date("G") <= 12):
echo "Good Morining";
break;
case(date("G") >= 13):
echo "Good Afternoon";
default:
echo "Cannot Determine";
}
echo $today;
?>
Thank you for your help.
<?php
$today = date("G");
switch(date("G")){
case(date("G") <= 12):
echo "Good Morining";
break;
case(date("G") >= 13):
echo "Good Afternoon";
default:
echo "Cannot Determine";
}
echo $today;
?>
Thank you for your help.
