Home >> Computer Language >> Php
Q.
Explain about switch statement in PHP?
Answer :
switch (n)
{
case 11:
code to be executed if n=1;
break;
case label2:
code to be executed if n=2;
break;
default:
code to be executed if n is different from both label1 and ;
}
{
case 11:
code to be executed if n=1;
break;
case label2:
code to be executed if n=2;
break;
default:
code to be executed if n is different from both label1 and ;
}
Posted By : moderator