Switch statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have no problem using the switch statement when I am checking if a
variable equals a known number, like such:

<?php
switch ($hour) {
case 0:
   echo "Go to sleep.";
   break;
case 10:
   echo "Good morning.";
   break;
case 22:
   echo "Good night.";
   break;
}
?>

However, how do I do it if the variable is larger than a certain
number? For instance, I want to say "Good night" if $hour is greater
than 22?

Thanks in advance.

Dotan Cohen
http://lyricslist.com/lyrics/biography/327/martin_ricky.php
Martin, Ricky Song Lyrics and Biography


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux