Definition: The PHP function switch () is used in place of several IF / ELSEIF statements. The default is optional, and is used if no other case is true. If you do not use a break; then all statements below your original statement will be treated as true.
Also Known As: Switch Loop
Examples:
<?php
switch ($i)
{
case 0:
echo "Zero";
break;
case 1:
echo "One";
break;
case 2:
echo "Two";
break;
default:
echo "Choose a different number";
}
?>

