PHP Switches

A switch is a very specific type of if statement. It can be used wen your decision is based on one variable and a list of options:

Today is '.$day.'!

'; switch ($day) { case "Monday": echo "Sounds like someone has a case of the Mondays!"; break; case "Friday": echo "TFIG!"; break; default: echo "Have a great day!"; break; } ?>