Switch:

               Switch statements work the same as if statements. However the difference is that they can check for multiple values. Of course you do the same with multiple if..else statements, but this is not always the best approach.

              Switch statement is used to select one option among various available options.

              The switch statement takes a single variable as input and then checks it against all cases we have in our switch statement.

Syntax :
<?php 
switch (expression)
{
	case case_1:
		//execute first block of code
		break;
	case case_2:
		//execute second block of code
		break;
	case case_3:
		//execute third block of code
		break;
	default:
		//execute this block of code if expression doesn't match any 
}
?>

Switch with Case
<?php 
$x='2';
switch ($x)
{
    case 1:
      echo "Number 1";
      break;
    case 2:
      echo "Number 2";
      break;
    case 3:
      echo "Number 3";
      break;
    default:
      echo "Number is not existed in all cases";
} 
?>

Output : Number 2

               In above Program, x is a variable and the value of x is 2, so when PHP performed the switch operation on x and search for a case with the value of "2". So execute the block of code that existed within the case 2.

Default Case in Switch

               In switch case, on of the case is executed if the case is existed. Otherwise the default case is executed when the case is not existed .

Default Case
<?php 
$x='10';
switch ($x)
{
case 1:
  echo "Number 1";
  break;
case 2:
  echo "Number 2";
  break;
case 3:
  echo "Number 3";
  break;
default:
  echo "Number is not existed in all cases";
} 
?>

               In above example, the value of x is 10 . There is three different cases are displayed. that are case1, case2 and case3. There is no case for value 10. So the default case is executed. ie. Number is not existed in all cases

Output : Number is not existed in all cases