php switch default other case code example
Example 1: php switch
$age=20;
switch ($age) {
case 19:
echo "Age is 18";
break;
case 20:
echo "Age is 20";
break;
case 21:
echo "Age is 21";
break;
}
Example 2: switch case or case php
switch ($your_variable)
{
case 1:
case 2:
echo "the value is either 1 or 2.";
break;
}