In a switch/case block, you specify what you are checking against, then give a list of possible values you want to handle. : switch statement « Statement « PHP
In a switch/case block, you specify what you are checking against, then give a list of possible values you want to handle.
<?php
$Name = 'Bob';
switch($Name) {
case "Jim":
print "Your name is Jim\n";
break;
case "Sally":
print "Your name is Sally\n";
break;
default:
print "I don't know your name!\n";
}
?>