The SWITCH statement takes single value as an input and check all conditions against all the different cases you set up for that SWITCH statement.
codes to be executed if n=label1;
codes to be executed if n=label2;
codes to be executed if n is different from both label1 and label2;
First we have a single expression "n"(most often a variable), that is evaluated once. The value of the expression is then compared with the values for each case in the structure. If there is a match, then the block of code associated with that case is executed.
Use BREAK to prevent the code from running into the next case automatically. The DEFAULT block is executed when there is no match..
echo "Your age is 20";
echo "your age is 21";
echo "Your age is 22";
echo "Your age is less than 20 or more than 22";