switch statement can be extremely useful in complex situations.
switch($variable)
{
case "a":
// run the code if $variable = a .
break;
case "b":
// run the code if $variable = b .
break;
case "c":
// run the code if $variable = c .
break;
default:
// run the code if $variable is not equal to either a,b or c
}
No comments:
Post a Comment