Switch case in PHP

The switch-case statement is an alternative to the if-elseif-else statement, which does almost the same thing. The switch-case statement tests a variable against a series of values until it finds a match, and then executes the block of code corresponding to that match.
switch(value)
case condition1:
break;
case condition2:
break

Below is example to display a different message for each month.
Example »

<?php

$today = date(“m”);

switch($month){

case “01”:

echo “Current month  is January.”;

break;

case “02”:

echo “Current month  is February.”;

break;

case “03”:

echo “Current month  is March.”;

break;

…….

default:

echo “It will return if case dows not exits.”;

break;

}

?>

Use break to prevent the code from running into the next case automatically