Search This Blog

Thursday, July 16, 2009

How to write Switch Case statement in PHP

HI all,

Here we can today learn how we could write a switch case construct in php. You know this statement we called it as conditional structure. that means this switch is used to do something if conditions provided are satisfied. this is basically equal to the if - else if - else statement.

here is the syntax for the Switch statment;

switch($var)
{
case "1":
echo"it is one";
break;
case "2":
echo"it is Two";
break;
case "3":
echo"it is Three";
break;
default:
echo "defaul Value ";
break;
}


No comments:

Post a Comment